Browse Source

remove default greetings per comment

master
NastiaS 7 years ago
parent
commit
cd87867285
  1. 21
      src/components/DashboardPage/index.js
  2. 1
      static/i18n/en/dashboard.yml

21
src/components/DashboardPage/index.js

@ -112,18 +112,15 @@ class DashboardPage extends PureComponent<Props, State> {
handleGreeting = () => { handleGreeting = () => {
const localTimeHour = new Date().getHours() const localTimeHour = new Date().getHours()
if (localTimeHour) { const afternoon_breakpoint = 12
const afternoon_breakpoint = 12 const evening_breakpoint = 17
const evening_breakpoint = 17
if (localTimeHour >= afternoon_breakpoint && localTimeHour < evening_breakpoint) {
if (localTimeHour >= afternoon_breakpoint && localTimeHour < evening_breakpoint) { return 'dashboard:greeting.afternoon'
return 'dashboard:greeting.afternoon' } else if (localTimeHour >= evening_breakpoint) {
} else if (localTimeHour >= evening_breakpoint) { return 'dashboard:greeting.evening'
return 'dashboard:greeting.evening'
}
return 'dashboard:greeting.morning'
} }
return '' return 'dashboard:greeting.morning'
} }
handleChangeSelectedTime = item => handleChangeSelectedTime = item =>
@ -145,7 +142,7 @@ class DashboardPage extends PureComponent<Props, State> {
<Box horizontal alignItems="flex-end"> <Box horizontal alignItems="flex-end">
<Box grow> <Box grow>
<Text color="dark" ff="Museo Sans" fontSize={7}> <Text color="dark" ff="Museo Sans" fontSize={7}>
{timeFrame ? t(timeFrame) : t('dashboard:defaultGreeting')} {t(timeFrame)}
</Text> </Text>
<Text color="grey" fontSize={5} ff="Museo Sans|Light"> <Text color="grey" fontSize={5} ff="Museo Sans|Light">
{totalAccounts > 0 {totalAccounts > 0

1
static/i18n/en/dashboard.yml

@ -3,7 +3,6 @@ greeting:
morning: "Good Morning!" morning: "Good Morning!"
evening: "Good Evening!" evening: "Good Evening!"
afternoon: "Good Afternoon!" afternoon: "Good Afternoon!"
defaultGreeting: 'Greetings!'
summary: here is the summary of your account summary: here is the summary of your account
summary_plural: 'here is the summary of your {{count}} accounts' summary_plural: 'here is the summary of your {{count}} accounts'
noAccounts: no accounts noAccounts: no accounts

Loading…
Cancel
Save