import React from 'react'; import PropTypes from 'prop-types'; import { translate } from 'react-i18next'; import SlackNotification from './SlackNotification'; import GrantSelector from './SavePageControls/GrantSelector'; class SavePageControls extends React.PureComponent { constructor(props) { super(props); this.state = { pageId: this.props.pageId, }; this.submit = this.submit.bind(this); } componentWillMount() { } /** * update pageId of state * @param {string} pageId */ setPageId(pageId) { this.setState({pageId}); } submit() { const slackNotificationState = this.refs.slackNotification.state; const grantSelectorState = this.refs.grantSelector.state; const options = Object.assign(slackNotificationState, grantSelectorState); this.props.onSubmit(options); } render() { const { t } = this.props; const label = this.state.pageId == null ? t('Create') : t('Update'); return (