mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
25 lines
No EOL
820 B
JavaScript
25 lines
No EOL
820 B
JavaScript
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.PostsNewForm/>
|
|
</ModalTrigger>
|
|
)
|
|
}
|
|
|
|
PostsNewButton.displayName = "PostsNewButton";
|
|
|
|
PostsNewButton.contextTypes = {
|
|
currentUser: React.PropTypes.object,
|
|
intl: intlShape
|
|
}
|
|
|
|
module.exports = PostsNewButton;
|
|
export default PostsNewButton; |