From 763fe1fe0f0c7baf8ba2c466c564bb2af3e0354c Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 12 Mar 2022 00:32:09 -0500 Subject: [PATCH] More notification updates --- src/common/layout/LayoutNotificationAlertView.tsx | 2 +- .../layout/LayoutNotificationBubbleView.tsx | 2 +- .../NotificationAlertLayoutView.types.ts | 7 ------- .../NotificationDefaultAlertView.tsx | 15 +++++++-------- .../alert-layouts/NotificationEventAlertView.tsx | 13 ++++++------- .../NotificationBubbleLayoutView.types.ts | 7 ------- .../NotificationClubGiftBubbleView.tsx | 12 ++++++++---- .../NotificationDefaultBubbleView.tsx | 10 +++++----- .../NotificationConfirmLayoutView.types.ts | 7 ------- .../NotificationDefaultConfirmView.tsx | 10 +++++----- 10 files changed, 33 insertions(+), 52 deletions(-) delete mode 100644 src/components/notification-center/views/alert-layouts/NotificationAlertLayoutView.types.ts delete mode 100644 src/components/notification-center/views/bubble-layouts/NotificationBubbleLayoutView.types.ts delete mode 100644 src/components/notification-center/views/confirm-layouts/NotificationConfirmLayoutView.types.ts diff --git a/src/common/layout/LayoutNotificationAlertView.tsx b/src/common/layout/LayoutNotificationAlertView.tsx index 3e11b0da..99a4d752 100644 --- a/src/common/layout/LayoutNotificationAlertView.tsx +++ b/src/common/layout/LayoutNotificationAlertView.tsx @@ -3,7 +3,7 @@ import { NitroCardContentView, NitroCardHeaderView, NitroCardView, NitroCardView export interface LayoutNotificationAlertViewProps extends NitroCardViewProps { - title: string; + title?: string; close: () => void; } diff --git a/src/common/layout/LayoutNotificationBubbleView.tsx b/src/common/layout/LayoutNotificationBubbleView.tsx index cac5b760..ab194ed3 100644 --- a/src/common/layout/LayoutNotificationBubbleView.tsx +++ b/src/common/layout/LayoutNotificationBubbleView.tsx @@ -2,7 +2,7 @@ import { FC, useEffect, useMemo, useState } from 'react'; import { Flex, FlexProps } from '..'; import { TransitionAnimation, TransitionAnimationTypes } from '../transitions'; -interface LayoutNotificationBubbleViewProps extends FlexProps +export interface LayoutNotificationBubbleViewProps extends FlexProps { fadesOut?: boolean; timeoutMs?: number; diff --git a/src/components/notification-center/views/alert-layouts/NotificationAlertLayoutView.types.ts b/src/components/notification-center/views/alert-layouts/NotificationAlertLayoutView.types.ts deleted file mode 100644 index c83877ac..00000000 --- a/src/components/notification-center/views/alert-layouts/NotificationAlertLayoutView.types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NotificationAlertItem } from '../../../../api'; - -export interface NotificationAlertLayoutViewProps -{ - item: NotificationAlertItem; - close: () => void; -} diff --git a/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx b/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx index eef9f5fd..3a6e50b1 100644 --- a/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx +++ b/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx @@ -1,16 +1,15 @@ -import { DetailsHTMLAttributes, FC, useCallback } from 'react'; -import { LocalizeText, NotificationUtilities } from '../../../../api'; -import { Base, Button, Column, LayoutNotificationAlertView } from '../../../../common'; -import { NotificationAlertLayoutViewProps } from './NotificationAlertLayoutView.types'; +import { FC, useCallback } from 'react'; +import { LocalizeText, NotificationAlertItem, NotificationUtilities } from '../../../../api'; +import { Base, Button, Column, LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common'; -interface NotificationDefaultAlertViewProps extends NotificationAlertLayoutViewProps, DetailsHTMLAttributes +interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewProps { - + item: NotificationAlertItem; } export const NotificationDefaultAlertView: FC = props => { - const { item = null, close = null, ...rest } = props; + const { item = null, title = (props.title || ''), close = null, ...rest } = props; const visitUrl = useCallback(() => { @@ -20,7 +19,7 @@ export const NotificationDefaultAlertView: FC }, [ item, close ]); return ( - + { (item.messages.length > 0) && item.messages.map((message, index) => { const htmlText = message.replace(/\r\n|\r|\n/g, '
'); diff --git a/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx b/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx index a6c039d6..43b64b04 100644 --- a/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx +++ b/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx @@ -1,16 +1,15 @@ -import { DetailsHTMLAttributes, FC, useCallback } from 'react'; -import { LocalizeText, NotificationUtilities } from '../../../../api'; -import { LayoutNotificationAlertView } from '../../../../common'; -import { NotificationAlertLayoutViewProps } from './NotificationAlertLayoutView.types'; +import { FC, useCallback } from 'react'; +import { LocalizeText, NotificationAlertItem, NotificationUtilities } from '../../../../api'; +import { LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common'; -interface NotificationEventAlertViewProps extends NotificationAlertLayoutViewProps, DetailsHTMLAttributes +export interface NotificationEventAlertViewProps extends LayoutNotificationAlertViewProps { - + item: NotificationAlertItem; } export const NotificationEventAlertView: FC = props => { - const { item = null, close = null, ...rest } = props; + const { item = null, title = (props.title || ''), close = null, ...rest } = props; const visitUrl = useCallback(() => { diff --git a/src/components/notification-center/views/bubble-layouts/NotificationBubbleLayoutView.types.ts b/src/components/notification-center/views/bubble-layouts/NotificationBubbleLayoutView.types.ts deleted file mode 100644 index 096924c2..00000000 --- a/src/components/notification-center/views/bubble-layouts/NotificationBubbleLayoutView.types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NotificationBubbleItem } from '../../../../api'; - -export interface NotificationBubbleLayoutViewProps -{ - item: NotificationBubbleItem; - close: () => void; -} diff --git a/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx b/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx index dc2adaf7..21955844 100644 --- a/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx +++ b/src/components/notification-center/views/bubble-layouts/NotificationClubGiftBubbleView.tsx @@ -1,9 +1,13 @@ import { FC } from 'react'; -import { LocalizeText, NotificationUtilities } from '../../../../api'; -import { LayoutCurrencyIcon, LayoutNotificationBubbleView } from '../../../../common'; -import { NotificationBubbleLayoutViewProps } from './NotificationBubbleLayoutView.types'; +import { LocalizeText, NotificationBubbleItem, NotificationUtilities } from '../../../../api'; +import { LayoutCurrencyIcon, LayoutNotificationBubbleView, LayoutNotificationBubbleViewProps } from '../../../../common'; -export const NotificationClubGiftBubbleView: FC = props => +export interface NotificationClubGiftBubbleViewProps extends LayoutNotificationBubbleViewProps +{ + item: NotificationBubbleItem; +} + +export const NotificationClubGiftBubbleView: FC = props => { const { item = null, close = null, ...rest } = props; diff --git a/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx b/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx index 68f23193..d1d78563 100644 --- a/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx +++ b/src/components/notification-center/views/bubble-layouts/NotificationDefaultBubbleView.tsx @@ -1,10 +1,10 @@ -import { DetailsHTMLAttributes, FC } from 'react'; -import { Flex, LayoutNotificationBubbleView, Text } from '../../../../common'; -import { NotificationBubbleLayoutViewProps } from './NotificationBubbleLayoutView.types'; +import { FC } from 'react'; +import { NotificationBubbleItem } from '../../../../api'; +import { Flex, LayoutNotificationBubbleView, LayoutNotificationBubbleViewProps, Text } from '../../../../common'; -interface NotificationDefaultBubbleViewProps extends NotificationBubbleLayoutViewProps, DetailsHTMLAttributes +export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBubbleViewProps { - + item: NotificationBubbleItem; } export const NotificationDefaultBubbleView: FC = props => diff --git a/src/components/notification-center/views/confirm-layouts/NotificationConfirmLayoutView.types.ts b/src/components/notification-center/views/confirm-layouts/NotificationConfirmLayoutView.types.ts deleted file mode 100644 index d03dc45b..00000000 --- a/src/components/notification-center/views/confirm-layouts/NotificationConfirmLayoutView.types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NotificationConfirmItem } from '../../../../api'; - -export interface NotificationConfirmLayoutViewProps -{ - item: NotificationConfirmItem; - close: () => void; -} diff --git a/src/components/notification-center/views/confirm-layouts/NotificationDefaultConfirmView.tsx b/src/components/notification-center/views/confirm-layouts/NotificationDefaultConfirmView.tsx index c793cc46..cd79bcaf 100644 --- a/src/components/notification-center/views/confirm-layouts/NotificationDefaultConfirmView.tsx +++ b/src/components/notification-center/views/confirm-layouts/NotificationDefaultConfirmView.tsx @@ -1,10 +1,10 @@ -import { DetailsHTMLAttributes, FC } from 'react'; -import { LayoutNotificationAlertView } from '../../../../common'; -import { NotificationConfirmLayoutViewProps } from './NotificationConfirmLayoutView.types'; +import { FC } from 'react'; +import { NotificationConfirmItem } from '../../../../api'; +import { LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common'; -export interface NotificationDefaultConfirmViewProps extends NotificationConfirmLayoutViewProps, DetailsHTMLAttributes +export interface NotificationDefaultConfirmViewProps extends LayoutNotificationAlertViewProps { - + item: NotificationConfirmItem; } export const NotificationDefaultConfirmView: FC = props =>