|
@@ -4,21 +4,24 @@ import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
import { createSubscribedElement } from '../../UnstatedUtils';
|
|
import { createSubscribedElement } from '../../UnstatedUtils';
|
|
|
import AppContainer from '../../../services/AppContainer';
|
|
import AppContainer from '../../../services/AppContainer';
|
|
|
|
|
+import UserInviteModal from './UserInviteModal';
|
|
|
|
|
|
|
|
class InviteUserControl extends React.Component {
|
|
class InviteUserControl extends React.Component {
|
|
|
-
|
|
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
this.state = {
|
|
|
-
|
|
|
|
|
|
|
+ isUserInviteModalShown: false,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- this.onUserInviteClicked = this.onUserInviteClicked.bind(this);
|
|
|
|
|
|
|
+ this.toggleUserInviteModal = this.toggleUserInviteModal.bind(this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- onUserInviteClicked() {
|
|
|
|
|
- this.props.toggleUserInviteModal();
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * user招待モーダルを開閉する
|
|
|
|
|
+ */
|
|
|
|
|
+ toggleUserInviteModal() {
|
|
|
|
|
+ this.setState({ isUserInviteModalShown: !this.state.isUserInviteModalShown });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
@@ -26,9 +29,13 @@ class InviteUserControl extends React.Component {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<Fragment>
|
|
<Fragment>
|
|
|
- <button type="button" className="btn btn-default" onClick={this.onUserInviteClicked}>
|
|
|
|
|
|
|
+ <button type="button" className="btn btn-default" onClick={this.toggleUserInviteModal}>
|
|
|
{ t('user_management.invite_users') }
|
|
{ t('user_management.invite_users') }
|
|
|
</button>
|
|
</button>
|
|
|
|
|
+ <UserInviteModal
|
|
|
|
|
+ show={this.state.isUserInviteModalShown}
|
|
|
|
|
+ onToggleModal={this.toggleUserInviteModal}
|
|
|
|
|
+ />
|
|
|
</Fragment>
|
|
</Fragment>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -42,7 +49,6 @@ const InviteUserControlWrapper = (props) => {
|
|
|
InviteUserControl.propTypes = {
|
|
InviteUserControl.propTypes = {
|
|
|
t: PropTypes.func.isRequired, // i18next
|
|
t: PropTypes.func.isRequired, // i18next
|
|
|
appContainer: PropTypes.instanceOf(AppContainer).isRequired,
|
|
appContainer: PropTypes.instanceOf(AppContainer).isRequired,
|
|
|
- toggleUserInviteModal: PropTypes.func.isRequired,
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default withTranslation()(InviteUserControlWrapper);
|
|
export default withTranslation()(InviteUserControlWrapper);
|