mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-07 13:02:36 +01:00
More notification updates
This commit is contained in:
parent
13f03b142a
commit
763fe1fe0f
@ -3,7 +3,7 @@ import { NitroCardContentView, NitroCardHeaderView, NitroCardView, NitroCardView
|
|||||||
|
|
||||||
export interface LayoutNotificationAlertViewProps extends NitroCardViewProps
|
export interface LayoutNotificationAlertViewProps extends NitroCardViewProps
|
||||||
{
|
{
|
||||||
title: string;
|
title?: string;
|
||||||
close: () => void;
|
close: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { FC, useEffect, useMemo, useState } from 'react';
|
|||||||
import { Flex, FlexProps } from '..';
|
import { Flex, FlexProps } from '..';
|
||||||
import { TransitionAnimation, TransitionAnimationTypes } from '../transitions';
|
import { TransitionAnimation, TransitionAnimationTypes } from '../transitions';
|
||||||
|
|
||||||
interface LayoutNotificationBubbleViewProps extends FlexProps
|
export interface LayoutNotificationBubbleViewProps extends FlexProps
|
||||||
{
|
{
|
||||||
fadesOut?: boolean;
|
fadesOut?: boolean;
|
||||||
timeoutMs?: number;
|
timeoutMs?: number;
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import { NotificationAlertItem } from '../../../../api';
|
|
||||||
|
|
||||||
export interface NotificationAlertLayoutViewProps
|
|
||||||
{
|
|
||||||
item: NotificationAlertItem;
|
|
||||||
close: () => void;
|
|
||||||
}
|
|
@ -1,16 +1,15 @@
|
|||||||
import { DetailsHTMLAttributes, FC, useCallback } from 'react';
|
import { FC, useCallback } from 'react';
|
||||||
import { LocalizeText, NotificationUtilities } from '../../../../api';
|
import { LocalizeText, NotificationAlertItem, NotificationUtilities } from '../../../../api';
|
||||||
import { Base, Button, Column, LayoutNotificationAlertView } from '../../../../common';
|
import { Base, Button, Column, LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common';
|
||||||
import { NotificationAlertLayoutViewProps } from './NotificationAlertLayoutView.types';
|
|
||||||
|
|
||||||
interface NotificationDefaultAlertViewProps extends NotificationAlertLayoutViewProps, DetailsHTMLAttributes<HTMLDivElement>
|
interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewProps
|
||||||
{
|
{
|
||||||
|
item: NotificationAlertItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps> = props =>
|
export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { item = null, close = null, ...rest } = props;
|
const { item = null, title = (props.title || ''), close = null, ...rest } = props;
|
||||||
|
|
||||||
const visitUrl = useCallback(() =>
|
const visitUrl = useCallback(() =>
|
||||||
{
|
{
|
||||||
@ -20,7 +19,7 @@ export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps>
|
|||||||
}, [ item, close ]);
|
}, [ item, close ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LayoutNotificationAlertView title={ item.title } close={ close } { ...rest }>
|
<LayoutNotificationAlertView title={ title } close={ close } { ...rest }>
|
||||||
{ (item.messages.length > 0) && item.messages.map((message, index) =>
|
{ (item.messages.length > 0) && item.messages.map((message, index) =>
|
||||||
{
|
{
|
||||||
const htmlText = message.replace(/\r\n|\r|\n/g, '<br />');
|
const htmlText = message.replace(/\r\n|\r|\n/g, '<br />');
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
import { DetailsHTMLAttributes, FC, useCallback } from 'react';
|
import { FC, useCallback } from 'react';
|
||||||
import { LocalizeText, NotificationUtilities } from '../../../../api';
|
import { LocalizeText, NotificationAlertItem, NotificationUtilities } from '../../../../api';
|
||||||
import { LayoutNotificationAlertView } from '../../../../common';
|
import { LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common';
|
||||||
import { NotificationAlertLayoutViewProps } from './NotificationAlertLayoutView.types';
|
|
||||||
|
|
||||||
interface NotificationEventAlertViewProps extends NotificationAlertLayoutViewProps, DetailsHTMLAttributes<HTMLDivElement>
|
export interface NotificationEventAlertViewProps extends LayoutNotificationAlertViewProps
|
||||||
{
|
{
|
||||||
|
item: NotificationAlertItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NotificationEventAlertView: FC<NotificationEventAlertViewProps> = props =>
|
export const NotificationEventAlertView: FC<NotificationEventAlertViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { item = null, close = null, ...rest } = props;
|
const { item = null, title = (props.title || ''), close = null, ...rest } = props;
|
||||||
|
|
||||||
const visitUrl = useCallback(() =>
|
const visitUrl = useCallback(() =>
|
||||||
{
|
{
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import { NotificationBubbleItem } from '../../../../api';
|
|
||||||
|
|
||||||
export interface NotificationBubbleLayoutViewProps
|
|
||||||
{
|
|
||||||
item: NotificationBubbleItem;
|
|
||||||
close: () => void;
|
|
||||||
}
|
|
@ -1,9 +1,13 @@
|
|||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { LocalizeText, NotificationUtilities } from '../../../../api';
|
import { LocalizeText, NotificationBubbleItem, NotificationUtilities } from '../../../../api';
|
||||||
import { LayoutCurrencyIcon, LayoutNotificationBubbleView } from '../../../../common';
|
import { LayoutCurrencyIcon, LayoutNotificationBubbleView, LayoutNotificationBubbleViewProps } from '../../../../common';
|
||||||
import { NotificationBubbleLayoutViewProps } from './NotificationBubbleLayoutView.types';
|
|
||||||
|
|
||||||
export const NotificationClubGiftBubbleView: FC<NotificationBubbleLayoutViewProps> = props =>
|
export interface NotificationClubGiftBubbleViewProps extends LayoutNotificationBubbleViewProps
|
||||||
|
{
|
||||||
|
item: NotificationBubbleItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const NotificationClubGiftBubbleView: FC<NotificationClubGiftBubbleViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { item = null, close = null, ...rest } = props;
|
const { item = null, close = null, ...rest } = props;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { DetailsHTMLAttributes, FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { Flex, LayoutNotificationBubbleView, Text } from '../../../../common';
|
import { NotificationBubbleItem } from '../../../../api';
|
||||||
import { NotificationBubbleLayoutViewProps } from './NotificationBubbleLayoutView.types';
|
import { Flex, LayoutNotificationBubbleView, LayoutNotificationBubbleViewProps, Text } from '../../../../common';
|
||||||
|
|
||||||
interface NotificationDefaultBubbleViewProps extends NotificationBubbleLayoutViewProps, DetailsHTMLAttributes<HTMLDivElement>
|
export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBubbleViewProps
|
||||||
{
|
{
|
||||||
|
item: NotificationBubbleItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NotificationDefaultBubbleView: FC<NotificationDefaultBubbleViewProps> = props =>
|
export const NotificationDefaultBubbleView: FC<NotificationDefaultBubbleViewProps> = props =>
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import { NotificationConfirmItem } from '../../../../api';
|
|
||||||
|
|
||||||
export interface NotificationConfirmLayoutViewProps
|
|
||||||
{
|
|
||||||
item: NotificationConfirmItem;
|
|
||||||
close: () => void;
|
|
||||||
}
|
|
@ -1,10 +1,10 @@
|
|||||||
import { DetailsHTMLAttributes, FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { LayoutNotificationAlertView } from '../../../../common';
|
import { NotificationConfirmItem } from '../../../../api';
|
||||||
import { NotificationConfirmLayoutViewProps } from './NotificationConfirmLayoutView.types';
|
import { LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common';
|
||||||
|
|
||||||
export interface NotificationDefaultConfirmViewProps extends NotificationConfirmLayoutViewProps, DetailsHTMLAttributes<HTMLDivElement>
|
export interface NotificationDefaultConfirmViewProps extends LayoutNotificationAlertViewProps
|
||||||
{
|
{
|
||||||
|
item: NotificationConfirmItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NotificationDefaultConfirmView: FC<NotificationDefaultConfirmViewProps> = props =>
|
export const NotificationDefaultConfirmView: FC<NotificationDefaultConfirmViewProps> = props =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user