Vulcan/packages/nova-base-components/lib/posts/PostsNewButton.jsx

27 lines
No EOL
953 B
JavaScript

import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
import { Button } from 'react-bootstrap';
import { ModalTrigger } from "meteor/nova:core";
const PostsNewButton = (props, context) => {
const size = context.currentUser ? "large" : "small";
const button = <Button className="posts-new-button" bsStyle="primary"><FormattedMessage id="posts.new_post"/></Button>;
return (
<ModalTrigger size={size} title={context.intl.formatMessage({id: "posts.new_post"})} component={button}>
<Telescope.components.PostsNewFormContainer component={Telescope.components.PostsNewForm} />
</ModalTrigger>
)
}
PostsNewButton.displayName = "PostsNewButton";
PostsNewButton.contextTypes = {
currentUser: React.PropTypes.object,
messages: React.PropTypes.object,
intl: intlShape
}
module.exports = PostsNewButton;
export default PostsNewButton;