MissingDescriptionModal to functional component
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
14337e7839
commit
2fbac4600c
1 changed files with 18 additions and 33 deletions
|
@ -10,41 +10,26 @@ const messages = defineMessages({
|
||||||
});
|
});
|
||||||
|
|
||||||
interface IMissingDescriptionModal {
|
interface IMissingDescriptionModal {
|
||||||
onClose: Function,
|
onClose: () => void,
|
||||||
onContinue: Function,
|
onContinue: () => void,
|
||||||
intl: IntlShape,
|
intl: IntlShape,
|
||||||
}
|
}
|
||||||
|
|
||||||
class MissingDescriptionModal extends React.PureComponent<IMissingDescriptionModal> {
|
const MissingDescriptionModal: React.FC<IMissingDescriptionModal> = ({ onClose, onContinue, intl }) => {
|
||||||
|
return (
|
||||||
handleContinue = () => {
|
<Modal
|
||||||
this.props.onClose();
|
title={intl.formatMessage(messages.modalTitle)}
|
||||||
this.props.onContinue();
|
confirmationAction={onContinue}
|
||||||
}
|
confirmationText={intl.formatMessage(messages.post)}
|
||||||
|
confirmationTheme='danger'
|
||||||
handleCancel = () => {
|
cancelText={intl.formatMessage(messages.cancel)}
|
||||||
this.props.onClose();
|
cancelAction={onClose}
|
||||||
}
|
>
|
||||||
|
<p className='text-gray-600 dark:text-gray-300'>
|
||||||
render() {
|
<FormattedMessage id='missing_description_modal.description' defaultMessage='Continue anyway?' />
|
||||||
const { intl } = this.props;
|
</p>
|
||||||
|
</Modal>
|
||||||
return (
|
);
|
||||||
<Modal
|
};
|
||||||
title={intl.formatMessage(messages.modalTitle)}
|
|
||||||
confirmationAction={this.handleContinue}
|
|
||||||
confirmationText={intl.formatMessage(messages.post)}
|
|
||||||
confirmationTheme='danger'
|
|
||||||
cancelText={intl.formatMessage(messages.cancel)}
|
|
||||||
cancelAction={this.handleCancel}
|
|
||||||
>
|
|
||||||
<p className='text-gray-600 dark:text-gray-300'>
|
|
||||||
<FormattedMessage id='missing_description_modal.description' defaultMessage='Continue anyway?' />
|
|
||||||
</p>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default injectIntl(MissingDescriptionModal);
|
export default injectIntl(MissingDescriptionModal);
|
||||||
|
|
Loading…
Reference in a new issue