import React from 'react'; import { forceOfflineConfig as dForceOfflineConfig, TForceOfflineConfig } from 'actions/config'; import OfflineSymbol from 'components/ui/OfflineSymbol'; import { connect } from 'react-redux'; import { AppState } from 'reducers'; type sizeType = 'small' | 'medium' | 'large'; interface OfflineToggleProps { offline: boolean; forceOffline: boolean; forceOfflineConfig: TForceOfflineConfig; size?: sizeType; } class OfflineToggle extends React.Component { public render() { const { forceOfflineConfig, offline, forceOffline, size } = this.props; return (
{!offline ? (
) : (
You are currently offline.
)}
); } } function mapStateToProps(state: AppState) { return { offline: state.config.offline, forceOffline: state.config.forceOffline }; } export default connect(mapStateToProps, { forceOfflineConfig: dForceOfflineConfig })(OfflineToggle);