digitransit-ui/app/component/NetworkError.js
2020-09-10 14:41:38 +03:00

31 lines
794 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import PropTypes from 'prop-types';
import React from 'react';
import { matchShape } from 'found';
import { FormattedMessage } from 'react-intl';
import Link from 'found/Link';
import Icon from './Icon';
const NetworkError = ({ retry }, { match }) => (
<div className="page-not-found">
<Icon img="icon-icon_error_page_not_found" />
<p>
<FormattedMessage
id="network-error"
defaultMessage="There was a network error"
/>
</p>
<p>
<Link to={match.location} onClick={retry}>
<FormattedMessage id="try-again" defaultMessage="Try again " />
</Link>
</p>
</div>
);
NetworkError.propTypes = { retry: PropTypes.func.isRequired };
NetworkError.contextTypes = {
match: matchShape.isRequired,
};
export default NetworkError;