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

35 lines
920 B
JavaScript
Raw Normal View History

2020-03-24 04:39:12 +00:00
import { defineMessages, injectIntl } from 'react-intl'
2020-03-26 03:11:32 +00:00
import Button from './button'
2019-07-02 08:10:25 +01: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 04:39:12 +00:00
})
2019-07-02 08:10:25 +01:00
2020-02-24 21:56:07 +00:00
export default
@injectIntl
class BundleColumnError extends PureComponent {
2019-07-02 08:10:25 +01:00
static propTypes = {
onRetry: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
handleRetry = () => {
2020-03-24 04:39:12 +00:00
this.props.onRetry()
2019-07-02 08:10:25 +01:00
}
render () {
2020-03-24 04:39:12 +00:00
const { intl: { formatMessage } } = this.props
2019-07-02 08:10:25 +01:00
return (
2020-02-24 23:25:55 +00:00
<div className='error-column'>
2020-03-26 03:11:32 +00:00
<Button title={formatMessage(messages.retry)} icon='refresh' onClick={this.handleRetry} size={64} />
2020-02-24 23:25:55 +00:00
{formatMessage(messages.body)}
</div>
2020-03-24 04:39:12 +00:00
)
2019-07-02 08:10:25 +01:00
}
}