mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
28 lines
944 B
JavaScript
28 lines
944 B
JavaScript
import { Components, registerComponent, withCurrentUser } from 'meteor/vulcan:core';
|
|
import React, { PropTypes, Component } from 'react';
|
|
import { FormattedMessage, intlShape } from 'react-intl';
|
|
import { Button } from 'react-bootstrap';
|
|
|
|
const PostsNewButton = (props, context) => {
|
|
|
|
const size = props.currentUser ? "large" : "small";
|
|
const button = <Button className="posts-new-button" bsStyle="primary"><FormattedMessage id="posts.new_post"/></Button>;
|
|
return (
|
|
<Components.ModalTrigger size={size} title={context.intl.formatMessage({id: "posts.new_post"})} component={button}>
|
|
<Components.PostsNewForm />
|
|
</Components.ModalTrigger>
|
|
)
|
|
}
|
|
|
|
PostsNewButton.displayName = "PostsNewButton";
|
|
|
|
PostsNewButton.propTypes = {
|
|
currentUser: React.PropTypes.object,
|
|
};
|
|
|
|
PostsNewButton.contextTypes = {
|
|
messages: React.PropTypes.object,
|
|
intl: intlShape
|
|
};
|
|
|
|
registerComponent('PostsNewButton', PostsNewButton, withCurrentUser);
|