Browse Source

Update banner also shows up on dashboard empty state

master
Thibaut Boustany 7 years ago
parent
commit
95bcf6ab88
No known key found for this signature in database GPG Key ID: 32475B11A2B13EEC
  1. 160
      src/components/DashboardPage/index.js
  2. 1
      src/components/UpdateNotifier/UpdateDownloaded.js

160
src/components/DashboardPage/index.js

@ -95,93 +95,95 @@ class DashboardPage extends PureComponent<Props, State> {
const displayOperations = accounts.some(displayOperationsHelper) const displayOperations = accounts.some(displayOperationsHelper)
return ( return (
<Box flow={7}> <Fragment>
{totalAccounts > 0 ? ( <UpdateNotifier />
<Fragment> <Box flow={7}>
<UpdateNotifier mt={-5} /> {totalAccounts > 0 ? (
<Box horizontal alignItems="flex-end">
<Box grow>
<Text color="dark" ff="Museo Sans" fontSize={7}>
{t(timeFrame)}
</Text>
<Text color="grey" fontSize={5} ff="Museo Sans|Light">
{t('app:dashboard.summary', { count: totalAccounts })}
</Text>
</Box>
<Box>
<PillsDaysCount
selectedTime={selectedTime}
onChange={this.handleChangeSelectedTime}
/>
</Box>
</Box>
<Fragment> <Fragment>
<BalanceSummary <Box horizontal alignItems="flex-end">
counterValue={counterValue} <Box grow>
chartId="dashboard-chart" <Text color="dark" ff="Museo Sans" fontSize={7}>
chartColor={colors.wallet} {t(timeFrame)}
accounts={accounts} </Text>
selectedTime={selectedTime} <Text color="grey" fontSize={5} ff="Museo Sans|Light">
daysCount={daysCount} {t('app:dashboard.summary', { count: totalAccounts })}
renderHeader={({ totalBalance, selectedTime, sinceBalance, refBalance }) => (
<BalanceInfos
t={t}
counterValue={counterValue}
totalBalance={totalBalance}
since={selectedTime}
sinceBalance={sinceBalance}
refBalance={refBalance}
/>
)}
/>
<Box flow={4}>
<Box horizontal alignItems="flex-end">
<Text color="dark" ff="Museo Sans" fontSize={6}>
{t('app:dashboard.accounts.title', { count: accounts.length })}
</Text> </Text>
<Box ml="auto" horizontal flow={1}>
<AccountsOrder />
</Box>
</Box> </Box>
<Box <Box>
horizontal <PillsDaysCount
flexWrap="wrap" selectedTime={selectedTime}
justifyContent="flex-start" onChange={this.handleChangeSelectedTime}
alignItems="center" />
style={{ margin: '0 -16px' }}
>
{accounts
.concat(Array(3 - (accounts.length % 3)).fill(null))
.map((account, i) => (
<Box key={account ? account.id : `placeholder_${i}`} flex="33%" p={16}>
{account ? (
<AccountCard
key={account.id}
counterValue={counterValue}
account={account}
daysCount={daysCount}
onClick={this.onAccountClick}
/>
) : null}
</Box>
))}
</Box> </Box>
</Box> </Box>
{displayOperations && ( <Fragment>
<OperationsList <BalanceSummary
onAccountClick={this.onAccountClick} counterValue={counterValue}
chartId="dashboard-chart"
chartColor={colors.wallet}
accounts={accounts} accounts={accounts}
title={t('app:dashboard.recentActivity')} selectedTime={selectedTime}
withAccount daysCount={daysCount}
renderHeader={({ totalBalance, selectedTime, sinceBalance, refBalance }) => (
<BalanceInfos
t={t}
counterValue={counterValue}
totalBalance={totalBalance}
since={selectedTime}
sinceBalance={sinceBalance}
refBalance={refBalance}
/>
)}
/> />
)} <Box flow={4}>
<StickyBackToTop /> <Box horizontal alignItems="flex-end">
<Text color="dark" ff="Museo Sans" fontSize={6}>
{t('app:dashboard.accounts.title', { count: accounts.length })}
</Text>
<Box ml="auto" horizontal flow={1}>
<AccountsOrder />
</Box>
</Box>
<Box
horizontal
flexWrap="wrap"
justifyContent="flex-start"
alignItems="center"
style={{ margin: '0 -16px' }}
>
{accounts
.concat(Array(3 - (accounts.length % 3)).fill(null))
.map((account, i) => (
<Box key={account ? account.id : `placeholder_${i}`} flex="33%" p={16}>
{account ? (
<AccountCard
key={account.id}
counterValue={counterValue}
account={account}
daysCount={daysCount}
onClick={this.onAccountClick}
/>
) : null}
</Box>
))}
</Box>
</Box>
{displayOperations && (
<OperationsList
onAccountClick={this.onAccountClick}
accounts={accounts}
title={t('app:dashboard.recentActivity')}
withAccount
/>
)}
<StickyBackToTop />
</Fragment>
</Fragment> </Fragment>
</Fragment> ) : (
) : ( <EmptyState />
<EmptyState /> )}
)} </Box>
</Box> </Fragment>
) )
} }
} }

1
src/components/UpdateNotifier/UpdateDownloaded.js

@ -35,6 +35,7 @@ const Container = styled(Box).attrs({
px: 3, px: 3,
bg: 'wallet', bg: 'wallet',
color: 'white', color: 'white',
mt: '-35px',
style: p => ({ style: p => ({
transform: `translate3d(0, ${p.offset}%, 0)`, transform: `translate3d(0, ${p.offset}%, 0)`,
}), }),

Loading…
Cancel
Save