Skip to content

Commit a6d033a

Browse files
committed
PM-2133 - PR feedback
1 parent 7b7d7b7 commit a6d033a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
const lsKeyPrefix = 'notificationDismissed'
2+
13
export const wasDismissed = (id: string): boolean => (
2-
(localStorage.getItem(`dismissed[${id}]`)) !== null
4+
(localStorage.getItem(`${lsKeyPrefix}[${id}]`)) !== null
35
)
46

57
export const dismiss = (id: string): void => {
6-
localStorage.setItem(`dismissed[${id}]`, JSON.stringify(true))
8+
localStorage.setItem(`${lsKeyPrefix}[${id}]`, JSON.stringify(true))
79
}

src/libs/ui/lib/components/notification/Notification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface NotificationProps {
1515
const Notification: FC<NotificationProps> = props => {
1616
const handleClose = useCallback((save?: boolean) => {
1717
props.onClose(props.notification.id, save)
18-
}, [props.onClose])
18+
}, [props.onClose, props.notification.id])
1919

2020
if (props.notification.type === 'banner') {
2121
return (

src/libs/ui/lib/components/notification/banner/NotificationBanner.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import NotificationBanner from './NotificationBanner'
55
const meta: Meta<typeof NotificationBanner> = {
66
argTypes: {
77
content: {
8-
description: 'Content displayed inside the tooltip',
8+
description: 'Content displayed inside the notification banner',
99
},
1010
persistent: {
1111
defaultValue: false,
12-
description: 'Set to true to allow clicks inside the tooltip',
12+
description: 'Set to true to hide the close icon button',
1313
},
1414
},
1515
component: NotificationBanner,

0 commit comments

Comments
 (0)