Files
freeCodeCamp/client/src/components/OfflineWarning/OfflineWarning.js
2018-09-30 12:42:40 +01:00

23 lines
528 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import './offline-warning.css';
const propTypes = {
isOnline: PropTypes.bool.isRequired,
isSignedIn: PropTypes.bool.isRequired
};
function OfflineWarning({ isOnline, isSignedIn }) {
return !isSignedIn || isOnline ? null : (
<div className='offline-warning'>
We cannot reach the server to update your progress.
</div>
);
}
OfflineWarning.displayName = 'OfflineWarning';
OfflineWarning.propTypes = propTypes;
export default OfflineWarning;