From 290060e6c42827224148343ee74238e59b9aad92 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 4 Oct 2017 14:49:41 +0200 Subject: [PATCH] Add sync warning to top --- js/src/Status/status.css | 14 ++++- js/src/Status/status.js | 98 ++++++++++++++++-------------- js/src/SyncWarning/syncWarning.css | 21 ------- js/src/SyncWarning/syncWarning.js | 96 ++++++----------------------- 4 files changed, 81 insertions(+), 148 deletions(-) diff --git a/js/src/Status/status.css b/js/src/Status/status.css index 7ef8ec3aa..3d9100a6d 100644 --- a/js/src/Status/status.css +++ b/js/src/Status/status.css @@ -17,16 +17,24 @@ $textColor: #ccc; -.status { - align-items: center; +.container { color: $textColor; - display: flex; left: 0; padding: 0.5rem 0.75rem; position: fixed; right: 0; top: 0; z-index: 1000; + + .status { + align-items: center; + display: flex; + } + + .warning { + background: red; + display: block; + } } .plugins { diff --git a/js/src/Status/status.js b/js/src/Status/status.js index f3e8d35c9..438ee82e6 100644 --- a/js/src/Status/status.js +++ b/js/src/Status/status.js @@ -31,6 +31,7 @@ import StatusIndicator from '@parity/ui/StatusIndicator'; import Consensus from './Consensus'; import AccountStore from '../ParityBar/accountStore'; import ParityBarStore from '../ParityBar/store'; +import SyncWarning from '../SyncWarning'; import PluginStore from './pluginStore'; import Upgrade from './Upgrade'; @@ -43,54 +44,57 @@ function Status ({ className = '', upgradeStore }, { api }) { const accountStore = AccountStore.get(api); return ( - - -
- - -
-
- { - pluginStore.components.map((Component, index) => ( - - )) - } -
- - - -
- + +
+ +
+ + +
+
+ { + pluginStore.components.map((Component, index) => ( + + )) } - /> - - } - /> - +
+ + + +
+ + } + /> + + } + /> + +
+
); diff --git a/js/src/SyncWarning/syncWarning.css b/js/src/SyncWarning/syncWarning.css index 2f5b178af..5280ecc68 100644 --- a/js/src/SyncWarning/syncWarning.css +++ b/js/src/SyncWarning/syncWarning.css @@ -15,27 +15,6 @@ /* along with Parity. If not; see . */ -.overlay { - background: rgba(255, 255, 255, 0.75); - bottom: 0; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 10000; -} - -.modal { - align-items: flex-start; - bottom: 0; - display: flex; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 10001; -} - .body { box-shadow: rgba(0, 0, 0, 0.25) 0 14px 45px, rgba(0, 0, 0, 0.22) 0 10px 18px; color: rgb(208, 208, 208); diff --git a/js/src/SyncWarning/syncWarning.js b/js/src/SyncWarning/syncWarning.js index 7a6da05d5..a5d8afb6e 100644 --- a/js/src/SyncWarning/syncWarning.js +++ b/js/src/SyncWarning/syncWarning.js @@ -16,105 +16,47 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; -import store from 'store'; -import Button from '@parity/ui/Button'; -import Checkbox from '@parity/ui/Form/Checkbox'; -import GradientBg from '@parity/ui/GradientBg'; import StatusIndicator from '@parity/ui/StatusIndicator'; import styles from './syncWarning.css'; -const LS_DONT_SHOW_AGAIN = '_parity::syncWarning::dontShowAgain'; - -export const showSyncWarning = () => { - const dontShowAgain = store.get(LS_DONT_SHOW_AGAIN); - - if (dontShowAgain === undefined || dontShowAgain === null) { - return true; - } - - return !dontShowAgain; -}; - class SyncWarning extends Component { static propTypes = { + className: PropTypes.string, isOk: PropTypes.bool.isRequired, health: PropTypes.object.isRequired }; - state = { - dontShowAgain: false, - show: true - }; - render () { - const { isOk, health } = this.props; - const { dontShowAgain, show } = this.state; + const { className, isOk, health } = this.props; - if (isOk || !show) { + if (isOk) { return null; } return ( -
-
-
- -
- -
- - { - health.overall.message.map(message => ( -

{ message }

- )) - } - -
- - } - checked={ dontShowAgain } - onClick={ this.handleCheck } - /> -
-
+
+
+
+ +
+ { + health.overall.message.map((message) => ( +

+ { message } +

+ )) + }
); } - - handleCheck = () => { - this.setState({ dontShowAgain: !this.state.dontShowAgain }); - } - - handleAgreeClick = () => { - if (this.state.dontShowAgain) { - store.set(LS_DONT_SHOW_AGAIN, true); - } - - this.setState({ show: false }); - } } function mapStateToProps (state) {