diff --git a/ui/app/components/app/multiple-notifications/multiple-notifications.component.js b/ui/app/components/app/multiple-notifications/multiple-notifications.component.js index 040890e18..a854a7dda 100644 --- a/ui/app/components/app/multiple-notifications/multiple-notifications.component.js +++ b/ui/app/components/app/multiple-notifications/multiple-notifications.component.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types' export default class MultipleNotifications extends PureComponent { static propTypes = { - notifications: PropTypes.array, + children: PropTypes.array, classNames: PropTypes.array, } @@ -14,11 +14,10 @@ export default class MultipleNotifications extends PureComponent { render () { const { showAll } = this.state - const { notifications, classNames = [] } = this.props + const { children, classNames = [] } = this.props - const notificationsToBeRendered = notifications.filter(notificationConfig => notificationConfig.shouldBeRendered) - - if (notificationsToBeRendered.length === 0) { + const childrenToRender = children.filter(child => child) + if (childrenToRender.length === 0) { return null } @@ -29,12 +28,12 @@ export default class MultipleNotifications extends PureComponent { 'home-notification-wrapper--show-first': !showAll, })} > - { notificationsToBeRendered.map(notificationConfig => notificationConfig.component) } + { childrenToRender }
this.setState({ showAll: !showAll })} > - {notificationsToBeRendered.length > 1 ? 1 ? : null}
diff --git a/ui/app/pages/home/home.component.js b/ui/app/pages/home/home.component.js index f96300c9c..531cca851 100644 --- a/ui/app/pages/home/home.component.js +++ b/ui/app/pages/home/home.component.js @@ -42,7 +42,7 @@ export default class Home extends PureComponent { selectedAddress: PropTypes.string, restoreFromThreeBox: PropTypes.func, setShowRestorePromptToFalse: PropTypes.func, - threeBoxLastUpdated: PropTypes.string, + threeBoxLastUpdated: PropTypes.number, } componentWillMount () { @@ -119,10 +119,10 @@ export default class Home extends PureComponent { + { + showPrivacyModeNotification + ? { @@ -134,11 +134,12 @@ export default class Home extends PureComponent { unsetMigratedPrivacyMode() }} key="home-privacyModeDefault" - />, - }, - { - shouldBeRendered: shouldShowSeedPhraseReminder, - component: + : null + } + { + shouldShowSeedPhraseReminder + ? { @@ -150,12 +151,13 @@ export default class Home extends PureComponent { }} infoText={t('backupApprovalInfo')} key="home-backupApprovalNotice" - />, - }, - { - shouldBeRendered: threeBoxLastUpdated && showRestorePrompt, - component: + : null + } + { + threeBoxLastUpdated && showRestorePrompt + ? , - }, - ]}/> + /> + : null + } + ) : null }