sforkowany z mirror/soapbox
MissingDescriptionModal to functional component
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>next-virtuoso-proof
rodzic
14337e7839
commit
2fbac4600c
|
@ -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 }) => {
|
||||||
|
|
||||||
handleContinue = () => {
|
|
||||||
this.props.onClose();
|
|
||||||
this.props.onContinue();
|
|
||||||
}
|
|
||||||
|
|
||||||
handleCancel = () => {
|
|
||||||
this.props.onClose();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { intl } = this.props;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={intl.formatMessage(messages.modalTitle)}
|
title={intl.formatMessage(messages.modalTitle)}
|
||||||
confirmationAction={this.handleContinue}
|
confirmationAction={onContinue}
|
||||||
confirmationText={intl.formatMessage(messages.post)}
|
confirmationText={intl.formatMessage(messages.post)}
|
||||||
confirmationTheme='danger'
|
confirmationTheme='danger'
|
||||||
cancelText={intl.formatMessage(messages.cancel)}
|
cancelText={intl.formatMessage(messages.cancel)}
|
||||||
cancelAction={this.handleCancel}
|
cancelAction={onClose}
|
||||||
>
|
>
|
||||||
<p className='text-gray-600 dark:text-gray-300'>
|
<p className='text-gray-600 dark:text-gray-300'>
|
||||||
<FormattedMessage id='missing_description_modal.description' defaultMessage='Continue anyway?' />
|
<FormattedMessage id='missing_description_modal.description' defaultMessage='Continue anyway?' />
|
||||||
</p>
|
</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default injectIntl(MissingDescriptionModal);
|
export default injectIntl(MissingDescriptionModal);
|
||||||
|
|
Ładowanie…
Reference in New Issue