Browse Source

Merge pull request #1767 from gre/allow-to-keep-sync-for-disruption-warnings

Allow to flag disabled currencies so they still keep in sync
gre-patch-1
Gaëtan Renaudeau 6 years ago
committed by GitHub
parent
commit
870faec6bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/bridge/BridgeSyncContext.js
  2. 9
      src/components/CurrenciesStatusBanner.js
  3. 4
      src/components/CurrencyDownStatusAlert.js
  4. 2
      src/reducers/currenciesStatus.js

3
src/bridge/BridgeSyncContext.js

@ -77,7 +77,8 @@ class Provider extends Component<BridgeSyncProviderOwnProps, Sync> {
return
}
if (currencyDownStatusLocal(this.props.currenciesStatus, account.currency)) {
const downStatus = currencyDownStatusLocal(this.props.currenciesStatus, account.currency)
if (downStatus && !downStatus.keepSync) {
next()
return
}

9
src/components/CurrenciesStatusBanner.js

@ -116,7 +116,11 @@ class BannerItem extends PureComponent<{
render() {
const { item, t } = this.props
return (
<Box relative key={item.id} style={styles.banner}>
<Box
relative
key={item.id}
style={{ ...styles.banner, ...(item.warning ? styles.warning : null) }}
>
<CloseIcon onClick={this.dismiss} />
<Box horizontal flow={2}>
<IconTriangleWarning height={16} width={16} color="white" />
@ -159,6 +163,9 @@ const styles = {
left: 32,
bottom: 32,
},
warning: {
background: colors.orange,
},
banner: {
background: colors.alertRed,
overflow: 'hidden',

4
src/components/CurrencyDownStatusAlert.js

@ -28,7 +28,7 @@ const CurrencyDownBox = styled(Box).attrs({
py: 2,
mb: 4,
})`
background-color: ${p => p.theme.colors.alertRed};
background-color: ${p => (p.warning ? p.theme.colors.orange : p.theme.colors.alertRed)};
`
const Link = styled.span`
@ -48,7 +48,7 @@ class CurrencyDownStatusAlert extends PureComponent<Props> {
const { status, t } = this.props
if (!status) return null
return (
<CurrencyDownBox>
<CurrencyDownBox warning={!!status.warning}>
<Box mr={2}>
<IconTriangleWarning height={16} width={16} />
</Box>

2
src/reducers/currenciesStatus.js

@ -15,6 +15,8 @@ export type CurrencyStatus = {
message: string,
link: string,
nonce: number,
warning?: boolean, // display as a warning
keepSync?: boolean, // even if something is happening, make live still stay in sync
}
export type CurrenciesStatusState = CurrencyStatus[]

Loading…
Cancel
Save