diff --git a/src/api/notification/NotificationUtilities.ts b/src/api/notification/NotificationUtilities.ts index a561fe73..45cc6311 100644 --- a/src/api/notification/NotificationUtilities.ts +++ b/src/api/notification/NotificationUtilities.ts @@ -1,6 +1,5 @@ import { HabboWebTools, RoomEnterEffect } from '@nitrots/nitro-renderer'; import { CreateLinkEvent, GetConfiguration, GetNitroInstance, LocalizeText } from '..'; -import { CatalogPageName } from '../../components/catalog/common/CatalogPageName'; import { NotificationAlertEvent, NotificationConfirmEvent } from '../../events'; import { NotificationBubbleEvent } from '../../events/notification-center/NotificationBubbleEvent'; import { DispatchUiEvent } from '../../hooks'; diff --git a/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx b/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx index 10235956..44b24271 100644 --- a/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx +++ b/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx @@ -1,6 +1,5 @@ -import { NotificationAlertItem, NotificationAlertType } from '../../../../api'; +import { NotificationAlertItem } from '../../../../api'; import { NotificationDefaultAlertView } from './NotificationDefaultAlertView'; -import { NotificationEventAlertView } from './NotificationEventAlertView'; export const GetAlertLayout = (item: NotificationAlertItem, close: () => void) => { @@ -8,11 +7,5 @@ export const GetAlertLayout = (item: NotificationAlertItem, close: () => void) = const props = { key: item.id, item, close }; - switch(item.alertType) - { - case NotificationAlertType.EVENT: - return - default: - return - } + return } diff --git a/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx b/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx index 13ab2fb8..3187faa9 100644 --- a/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx +++ b/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx @@ -18,6 +18,8 @@ export const NotificationDefaultAlertView: FC close(); }, [ item, close ]); + const isAction = (item.clickUrl && item.clickUrl.startsWith('event:')); + return ( { (item.messages.length > 0) && item.messages.map((message, index) => @@ -27,9 +29,12 @@ export const NotificationDefaultAlertView: FC return ; }) } - - { item.clickUrl && item.clickUrl.length && + { !isAction && + } + { !isAction && item.clickUrl && (item.clickUrl.length > 0) && } + { isAction && item.clickUrl && (item.clickUrl.length > 0) && + } ); diff --git a/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx b/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx deleted file mode 100644 index dc016e45..00000000 --- a/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { FC, useCallback } from 'react'; -import { LocalizeText, NotificationAlertItem, NotificationUtilities } from '../../../../api'; -import { LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common'; - -export interface NotificationEventAlertViewProps extends LayoutNotificationAlertViewProps -{ - item: NotificationAlertItem; -} - -export const NotificationEventAlertView: FC = props => -{ - const { item = null, title = ((props.item && props.item.title) || ''), close = null, ...rest } = props; - - const visitUrl = useCallback(() => - { - NotificationUtilities.openUrl(item.clickUrl); - - close(); - }, [ item, close ]); - - return ( - - { (item.messages.length > 0) && item.messages.map((message, index) => - { - const htmlText = message.replace(/\r\n|\r|\n/g, '
'); - - return ( -
- ); - }) } -
- -
- - ); -}