about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/drawer/header/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-09-06 19:17:14 +0200
committerThibG <thib@sitedethib.com>2018-09-07 20:37:17 +0200
commit2cdc00bc8b41235b06090d34187ca71b8749aa27 (patch)
tree885179bab4b4f9297e4cfce15cc86f75719471a2 /app/javascript/flavours/glitch/features/drawer/header/index.js
parent0f155af32a330bc8eb79c6e3ccec5331a1e37922 (diff)
Add unread notifications badge to the navigation bar
Diffstat (limited to 'app/javascript/flavours/glitch/features/drawer/header/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/drawer/header/index.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/drawer/header/index.js b/app/javascript/flavours/glitch/features/drawer/header/index.js
index deec42435..435538de4 100644
--- a/app/javascript/flavours/glitch/features/drawer/header/index.js
+++ b/app/javascript/flavours/glitch/features/drawer/header/index.js
@@ -46,6 +46,7 @@ const messages = defineMessages({
 //  The component.
 export default function DrawerHeader ({
   columns,
+  unreadNotifications,
   intl,
   onSettingsClick,
 }) {
@@ -77,7 +78,12 @@ export default function DrawerHeader ({
           aria-label={intl.formatMessage(messages.notifications)}
           title={intl.formatMessage(messages.notifications)}
           to='/notifications'
-        ><Icon icon='bell' /></Link>
+        >
+          <span className='icon-badge-wrapper'>
+            <Icon icon='bell' />
+            { unreadNotifications > 0 && <div className='icon-badge' />}
+          </span>
+        </Link>
       ))}
       {renderForColumn('COMMUNITY', (
         <Link
@@ -112,6 +118,7 @@ export default function DrawerHeader ({
 //  Props.
 DrawerHeader.propTypes = {
   columns: ImmutablePropTypes.list,
+  unreadNotifications: PropTypes.number,
   intl: PropTypes.object,
   onSettingsClick: PropTypes.func,
 };