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

24 lines
779 B
React
Raw Normal View History

2016-03-25 10:45:28 +09:00
import React, { PropTypes, Component } from 'react';
2016-06-09 17:42:20 +09:00
import {FormattedMessage, intlShape} from 'react-intl';
2016-03-25 10:45:28 +09:00
import { Button } from 'react-bootstrap';
2016-05-22 15:23:30 +09:00
import { ModalTrigger } from "meteor/nova:core";
const PostsNewButton = (props, context) => {
2016-03-25 10:45:28 +09:00
const size = context.currentUser ? "small" : "large";
2016-06-09 17:42:20 +09:00
const button = <Button className="posts-new-button" bsStyle="primary"><FormattedMessage id="posts.new_post"/></Button>;
2016-03-25 10:45:28 +09:00
return (
2016-06-09 17:42:20 +09:00
<ModalTrigger size={size} title={context.intl.formatMessage({id: "posts.new_post"})} component={button}>
<Telescope.components.PostsNewForm/>
2016-03-25 10:45:28 +09:00
</ModalTrigger>
)
}
PostsNewButton.displayName = "PostsNewButton";
2016-06-09 17:42:20 +09:00
PostsNewButton.contextTypes = {
intl: intlShape
}
module.exports = PostsNewButton;
export default PostsNewButton;