logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

bundle_modal_error.js (1565B)


  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { defineMessages, injectIntl } from 'react-intl';
  4. import IconButton from '../../../components/icon_button';
  5. const messages = defineMessages({
  6. error: { id: 'bundle_modal_error.message', defaultMessage: 'Something went wrong while loading this component.' },
  7. retry: { id: 'bundle_modal_error.retry', defaultMessage: 'Try again' },
  8. close: { id: 'bundle_modal_error.close', defaultMessage: 'Close' },
  9. });
  10. class BundleModalError extends React.PureComponent {
  11. static propTypes = {
  12. onRetry: PropTypes.func.isRequired,
  13. onClose: PropTypes.func.isRequired,
  14. intl: PropTypes.object.isRequired,
  15. }
  16. handleRetry = () => {
  17. this.props.onRetry();
  18. }
  19. render () {
  20. const { onClose, intl: { formatMessage } } = this.props;
  21. // Keep the markup in sync with <ModalLoading />
  22. // (make sure they have the same dimensions)
  23. return (
  24. <div className='modal-root__modal error-modal'>
  25. <div className='error-modal__body'>
  26. <IconButton title={formatMessage(messages.retry)} icon='refresh' onClick={this.handleRetry} size={64} />
  27. {formatMessage(messages.error)}
  28. </div>
  29. <div className='error-modal__footer'>
  30. <div>
  31. <button
  32. onClick={onClose}
  33. className='error-modal__nav onboarding-modal__skip'
  34. >
  35. {formatMessage(messages.close)}
  36. </button>
  37. </div>
  38. </div>
  39. </div>
  40. );
  41. }
  42. }
  43. export default injectIntl(BundleModalError);