From 7db1696d7cf9626dbb7fe30006f5703c72c77d01 Mon Sep 17 00:00:00 2001 From: meriadec Date: Mon, 14 May 2018 17:10:34 +0200 Subject: [PATCH] Design update of the update notifier banner --- src/components/DashboardPage/index.js | 2 ++ src/components/UpdateNotifier.js | 42 ++++++++++++--------------- src/components/layout/Default.js | 2 -- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/components/DashboardPage/index.js b/src/components/DashboardPage/index.js index f6a567ea..aec0c8a3 100644 --- a/src/components/DashboardPage/index.js +++ b/src/components/DashboardPage/index.js @@ -24,6 +24,7 @@ import { getCounterValueCode, localeSelector } from 'reducers/settings' import { updateOrderAccounts } from 'actions/accounts' import { saveSettings } from 'actions/settings' +import UpdateNotifier from 'components/UpdateNotifier' import BalanceInfos from 'components/BalanceSummary/BalanceInfos' import BalanceSummary from 'components/BalanceSummary' import Box from 'components/base/Box' @@ -139,6 +140,7 @@ class DashboardPage extends PureComponent { return ( + diff --git a/src/components/UpdateNotifier.js b/src/components/UpdateNotifier.js index f2755d31..9ca14836 100644 --- a/src/components/UpdateNotifier.js +++ b/src/components/UpdateNotifier.js @@ -3,7 +3,6 @@ import React, { PureComponent } from 'react' import { translate } from 'react-i18next' import { compose } from 'redux' -import { Motion, spring } from 'react-motion' import { connect } from 'react-redux' import styled from 'styled-components' @@ -12,6 +11,8 @@ import { sendEvent } from 'renderer/events' import type { State } from 'reducers' import type { UpdateStatus } from 'reducers/update' +import { radii } from 'styles/theme' + import Box from 'components/base/Box' import Text from 'components/base/Text' @@ -28,18 +29,15 @@ const mapStateToProps = (state: State) => ({ }) const Container = styled(Box).attrs({ - p: 1, + py: 1, + px: 3, bg: 'wallet', color: 'white', style: p => ({ transform: `translate3d(0, ${p.offset}%, 0)`, }), })` - position: absolute; - top: 0; - left: 0; - right: 0; - z-index: 10; + border-radius: ${radii[1]}px; ` class UpdateNotifier extends PureComponent { @@ -57,12 +55,14 @@ class UpdateNotifier extends PureComponent { return ( {t('update:newVersionReady')} - sendEvent('msg', 'updater:quitAndInstall')} - > - {t('update:relaunch')} - + + sendEvent('msg', 'updater:quitAndInstall')} + > + {t('update:relaunch')} + + ) default: @@ -71,18 +71,14 @@ class UpdateNotifier extends PureComponent { } render() { - const { updateStatus } = this.props + const { updateStatus, ...props } = this.props const isToggled = updateStatus === 'downloaded' - return ( - - {m => {this.renderStatus()}} - - ) + + if (!isToggled) { + return null + } + return {this.renderStatus()} } } diff --git a/src/components/layout/Default.js b/src/components/layout/Default.js index 56e8da24..7e109f7b 100644 --- a/src/components/layout/Default.js +++ b/src/components/layout/Default.js @@ -23,7 +23,6 @@ import AppRegionDrag from 'components/AppRegionDrag' import IsUnlocked from 'components/IsUnlocked' import SideBar from 'components/SideBar' import TopBar from 'components/TopBar' -import UpdateNotifier from 'components/UpdateNotifier' const Container = styled(GrowScroll).attrs({ p: 6, @@ -87,7 +86,6 @@ class Default extends Component { - (this._scrollContainer = n)} onScroll={this.handleScroll}>