Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c3000df

Browse files
committedMar 2, 2020
Fix Issue #161 : Unseen notifications counter in mobile view
1 parent ef383b0 commit c3000df

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed
 

‎dist/dev/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/prod/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/components/AccountMenu/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import IconAvatar from '../../assets/images/img-vic-tor-avatar.svg'
77
import IconCloseDark from '../../assets/images/icon-close-dark.svg'
88
import IconSwitchBusiness from '../../assets/images/icon-switch-business.svg'
99
import IconNotificationsRed from '../../assets/images/icon-bell-red.svg'
10+
import IconNotificationsGrey from '../../assets/images/icon-bell-grey.svg'
1011
import IconRightArrow from '../../assets/images/right-arrow.svg'
1112
import styles from './styles.module.scss'
1213
import moment from 'moment'
@@ -99,10 +100,15 @@ class AccountMenu extends React.Component {
99100
onClick={onClickNotifications}
100101
>
101102
<div className={styles['noti-left']}>
102-
<IconNotificationsRed className={styles['bell-icon']} />
103+
{numNotifications > 0
104+
? <IconNotificationsRed className={styles['bell-icon']} />
105+
: <IconNotificationsGrey className={styles['bell-icon']} />
106+
}
103107
<div>
104108
<span className={styles['notifications-title']}>Notifications</span>
105-
<span className={styles['red-number']}>{'(' + numNotifications + ')'}</span>
109+
{numNotifications > 0 &&
110+
<span className={styles['red-number']}>{'(' + numNotifications + ')'}</span>
111+
}
106112
</div>
107113
</div>
108114
<span role='button' className={styles['icon-open-noti']}>

‎src/components/LoginNav/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const LoginNav = ({
100100
open={openAccountMenu}
101101
menu={accountMenu}
102102
switchText={switchText}
103-
numNotifications={(notifications || []).length}
103+
numNotifications={_.filter((notifications || []), n => n.isSeen === false).length}
104104
onClickNotifications={handleClickNotifications}
105105
onSwitch={onSwitch}
106106
onClose={() => {

0 commit comments

Comments
 (0)
Please sign in to comment.