mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-18 21:36:27 +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
|
||||
{
|
||||
title: string;
|
||||
title?: string;
|
||||
close: () => void;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 { 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<HTMLDivElement>
|
||||
interface NotificationDefaultAlertViewProps extends LayoutNotificationAlertViewProps
|
||||
{
|
||||
|
||||
item: NotificationAlertItem;
|
||||
}
|
||||
|
||||
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(() =>
|
||||
{
|
||||
@ -20,7 +19,7 @@ export const NotificationDefaultAlertView: FC<NotificationDefaultAlertViewProps>
|
||||
}, [ item, close ]);
|
||||
|
||||
return (
|
||||
<LayoutNotificationAlertView title={ item.title } close={ close } { ...rest }>
|
||||
<LayoutNotificationAlertView title={ title } close={ close } { ...rest }>
|
||||
{ (item.messages.length > 0) && item.messages.map((message, index) =>
|
||||
{
|
||||
const htmlText = message.replace(/\r\n|\r|\n/g, '<br />');
|
||||
|
@ -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<HTMLDivElement>
|
||||
export interface NotificationEventAlertViewProps extends LayoutNotificationAlertViewProps
|
||||
{
|
||||
|
||||
item: NotificationAlertItem;
|
||||
}
|
||||
|
||||
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(() =>
|
||||
{
|
||||
|
@ -1,7 +0,0 @@
|
||||
import { NotificationBubbleItem } from '../../../../api';
|
||||
|
||||
export interface NotificationBubbleLayoutViewProps
|
||||
{
|
||||
item: NotificationBubbleItem;
|
||||
close: () => void;
|
||||
}
|
@ -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<NotificationBubbleLayoutViewProps> = props =>
|
||||
export interface NotificationClubGiftBubbleViewProps extends LayoutNotificationBubbleViewProps
|
||||
{
|
||||
item: NotificationBubbleItem;
|
||||
}
|
||||
|
||||
export const NotificationClubGiftBubbleView: FC<NotificationClubGiftBubbleViewProps> = props =>
|
||||
{
|
||||
const { item = null, close = null, ...rest } = props;
|
||||
|
||||
|
@ -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<HTMLDivElement>
|
||||
export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBubbleViewProps
|
||||
{
|
||||
|
||||
item: NotificationBubbleItem;
|
||||
}
|
||||
|
||||
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 { 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<HTMLDivElement>
|
||||
export interface NotificationDefaultConfirmViewProps extends LayoutNotificationAlertViewProps
|
||||
{
|
||||
|
||||
item: NotificationConfirmItem;
|
||||
}
|
||||
|
||||
export const NotificationDefaultConfirmView: FC<NotificationDefaultConfirmViewProps> = props =>
|
||||
|
Loading…
Reference in New Issue
Block a user