gab-social/app/javascript/gabsocial/components/bundle_column_error.js

35 lines
920 B
JavaScript
Raw Normal View History

2020-03-24 00:39:12 -04:00
import { defineMessages, injectIntl } from 'react-intl'
2020-03-25 23:11:32 -04:00
import Button from './button'
2019-07-02 03:10:25 -04:00
const messages = defineMessages({
title: { id: 'bundle_column_error.title', defaultMessage: 'Network error' },
body: { id: 'bundle_column_error.body', defaultMessage: 'Something went wrong while loading this component.' },
retry: { id: 'bundle_column_error.retry', defaultMessage: 'Try again' },
2020-03-24 00:39:12 -04:00
})
2019-07-02 03:10:25 -04:00
2020-02-24 16:56:07 -05:00
export default
@injectIntl
class BundleColumnError extends PureComponent {
2019-07-02 03:10:25 -04:00
static propTypes = {
onRetry: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
handleRetry = () => {
2020-03-24 00:39:12 -04:00
this.props.onRetry()
2019-07-02 03:10:25 -04:00
}
render () {
2020-03-24 00:39:12 -04:00
const { intl: { formatMessage } } = this.props
2019-07-02 03:10:25 -04:00
return (
2020-02-24 18:25:55 -05:00
<div className='error-column'>
2020-03-25 23:11:32 -04:00
<Button title={formatMessage(messages.retry)} icon='refresh' onClick={this.handleRetry} size={64} />
2020-02-24 18:25:55 -05:00
{formatMessage(messages.body)}
</div>
2020-03-24 00:39:12 -04:00
)
2019-07-02 03:10:25 -04:00
}
}