diff --git a/src/components/notification-center/views/bubble-layouts/GetBubbleLayout.tsx b/src/components/notification-center/views/bubble-layouts/GetBubbleLayout.tsx index 8e4e262..0d69f74 100644 --- a/src/components/notification-center/views/bubble-layouts/GetBubbleLayout.tsx +++ b/src/components/notification-center/views/bubble-layouts/GetBubbleLayout.tsx @@ -11,12 +11,12 @@ export const GetBubbleLayout = ( ) => { if (!item) return null; - const props = { key: item.id, item, onClose }; + const props = { item, onClose }; switch (item.notificationType) { case NotificationBubbleType.CLUBGIFT: - return ; + return ; default: - return ; + return ; } }; diff --git a/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx b/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx index 0ec7355..bb2eb47 100644 --- a/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx +++ b/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx @@ -2,25 +2,28 @@ import { FC } from 'react'; import { LocalizeText, NotificationBubbleItem, OpenUrl } from '../../../../api'; import { LayoutCurrencyIcon, LayoutNotificationBubbleView, LayoutNotificationBubbleViewProps } from '../../../../common'; -export interface NotificationClubGiftBubbleViewProps extends LayoutNotificationBubbleViewProps -{ - item: NotificationBubbleItem; +export interface NotificationClubGiftBubbleViewProps extends LayoutNotificationBubbleViewProps { + item: NotificationBubbleItem; } -export const NotificationClubGiftBubbleView: FC = props => -{ - const { item = null, onClose = null, ...rest } = props; +export const NotificationClubGiftBubbleView: FC = props => { + // Don't try to destructure key from props! + const { item = null, onClose = null, ...restProps } = props; - return ( - -
- - { LocalizeText('notifications.text.club_gift') } -
-
- - { LocalizeText('notifications.button.later') } -
-
- ); -} + return ( + +
+ + { LocalizeText('notifications.text.club_gift') } +
+
+ + + { LocalizeText('notifications.button.later') } + +
+
+ ); +}; diff --git a/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx b/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx index 91f0011..0a360cf 100644 --- a/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx +++ b/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx @@ -2,24 +2,25 @@ import { FC } from 'react'; import { NotificationBubbleItem, OpenUrl } from '../../../../api'; import { Flex, LayoutNotificationBubbleView, LayoutNotificationBubbleViewProps, Text } from '../../../../common'; -export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBubbleViewProps -{ - item: NotificationBubbleItem; +export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBubbleViewProps { + item: NotificationBubbleItem; } -export const NotificationDefaultBubbleView: FC = props => -{ - const { item = null, onClose = null, ...rest } = props; - - const htmlText = item.message.replace(/\r\n|\r|\n/g, '
'); +export const NotificationDefaultBubbleView: FC = props => { + // Do not destructure key! + const { item = null, onClose = null, ...restProps } = props; + + const htmlText = item.message.replace(/\r\n|\r|\n/g, '
'); - return ( - (item.linkUrl && item.linkUrl.length && OpenUrl(item.linkUrl)) } { ...rest }> - - { (item.iconUrl && item.iconUrl.length) && - } - - - - ); -} + return ( + (item.linkUrl && item.linkUrl.length && OpenUrl(item.linkUrl)) } + { ...restProps }> + + { (item.iconUrl && item.iconUrl.length) && + } + + + + ); +};