mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-13 22:00:19 -04:00
23 lines
528 B
JavaScript
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;
|