logo

mastofe

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

bundle_column_error.js (1362B)


  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { defineMessages, injectIntl } from 'react-intl';
  4. import Column from './column';
  5. import ColumnHeader from './column_header';
  6. import ColumnBackButtonSlim from '../../../components/column_back_button_slim';
  7. import IconButton from '../../../components/icon_button';
  8. const messages = defineMessages({
  9. title: { id: 'bundle_column_error.title', defaultMessage: 'Network error' },
  10. body: { id: 'bundle_column_error.body', defaultMessage: 'Something went wrong while loading this component.' },
  11. retry: { id: 'bundle_column_error.retry', defaultMessage: 'Try again' },
  12. });
  13. class BundleColumnError extends React.PureComponent {
  14. static propTypes = {
  15. onRetry: PropTypes.func.isRequired,
  16. intl: PropTypes.object.isRequired,
  17. }
  18. handleRetry = () => {
  19. this.props.onRetry();
  20. }
  21. render () {
  22. const { intl: { formatMessage } } = this.props;
  23. return (
  24. <Column>
  25. <ColumnHeader icon='exclamation-circle' type={formatMessage(messages.title)} />
  26. <ColumnBackButtonSlim />
  27. <div className='error-column'>
  28. <IconButton title={formatMessage(messages.retry)} icon='refresh' onClick={this.handleRetry} size={64} />
  29. {formatMessage(messages.body)}
  30. </div>
  31. </Column>
  32. );
  33. }
  34. }
  35. export default injectIntl(BundleColumnError);