mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-16 04:57:08 +00:00
* Banner announcement cuts off mailchimp on mobile * Hide site version on mobile. Added version to footer as well in case someone _really_ needs to check it. * Shrink pre-footer font size on mobile. * Fix column breakpoint for force offline send (Was stacking, now remains side-by-side.) * Reduce header dropdown sizes at mobile. Force gas dropdown to the left side so its not offscreen. * Columnify contracts for better mobile behavior and less code. * Remove leftover string interpolation * Better mobile header / nav sizing.
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
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<OfflineToggleProps, {}> {
|
|
public render() {
|
|
const { forceOfflineConfig, offline, forceOffline, size } = this.props;
|
|
|
|
return (
|
|
<div>
|
|
{!offline ? (
|
|
<div className="row text-center">
|
|
<div className="col-xs-3">
|
|
<OfflineSymbol offline={offline || forceOffline} size={size} />
|
|
</div>
|
|
<div className="col-xs-6">
|
|
<button className="btn-xs btn-info" onClick={forceOfflineConfig}>
|
|
{forceOffline ? 'Go Online' : 'Go Offline'}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
) : (
|
|
<div className="text-center">
|
|
<h5>You are currently offline.</h5>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
function mapStateToProps(state: AppState) {
|
|
return {
|
|
offline: state.config.offline,
|
|
forceOffline: state.config.forceOffline
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, {
|
|
forceOfflineConfig: dForceOfflineConfig
|
|
})(OfflineToggle);
|