Skip to content

Commit 364cb08

Browse files
christianalfoniCompuIves
authored andcommitted
Fix notifications (codesandbox#2448)
* Fix notifications * remove comment
1 parent d47e926 commit 364cb08

File tree

1 file changed

+23
-17
lines changed
  • packages/app/src/app/pages/common/Navigation

1 file changed

+23
-17
lines changed

packages/app/src/app/pages/common/Navigation/index.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { inject, hooksObserver } from 'app/componentConnectors';
2+
import { inject, hooksObserver, Observer } from 'app/componentConnectors';
33
import { Link } from 'react-router-dom';
44
import Media from 'react-media';
55
import {
@@ -102,22 +102,28 @@ export const Navigation = inject('store', 'signals')(
102102
noHeightAnimation
103103
>
104104
{open => (
105-
<Action
106-
style={{ position: 'relative', fontSize: '1.25rem' }}
107-
onClick={open}
108-
>
109-
<Tooltip
110-
placement="bottom"
111-
content={
112-
userNotifications.unreadCount > 0
113-
? 'Show Notifications'
114-
: 'No Notifications'
115-
}
116-
>
117-
<BellIcon height={35} />
118-
{userNotifications.unreadCount > 0 && <UnreadIcon />}
119-
</Tooltip>
120-
</Action>
105+
<Observer>
106+
{({ store }) => (
107+
<Action
108+
style={{ position: 'relative', fontSize: '1.25rem' }}
109+
onClick={open}
110+
>
111+
<Tooltip
112+
placement="bottom"
113+
content={
114+
store.userNotifications.unreadCount > 0
115+
? 'Show Notifications'
116+
: 'No Notifications'
117+
}
118+
>
119+
<BellIcon height={35} />
120+
{store.userNotifications.unreadCount > 0 && (
121+
<UnreadIcon />
122+
)}
123+
</Tooltip>
124+
</Action>
125+
)}
126+
</Observer>
121127
)}
122128
</Overlay>
123129
)}

0 commit comments

Comments
 (0)