5180 fichiers 38.5 Mo 0 téléchargements 474 vues mis à jour il y a 7 heures ui
nitro-v36-with-renderer-v36 / src / components / notification-center / views / bubble-layouts / NotificationDefaultBubbleView.tsx
NotificationDefaultBubbleView.tsx 1.2 Ko Télécharger le fichier
import { FC } from 'react';
import { NotificationBubbleItem, OpenUrl, SanitizeHtml } from '../../../../api';
import { LayoutNotificationBubbleViewProps } from '../../../../common';
import { NativeTextTree } from '../../../../common/native-text/NativeTextTree';
import { getBubbleIcon, getBubbleLink } from './bubbleDefaults';
import { NotificationItemLayoutView } from './NotificationItemLayoutView';

export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBubbleViewProps {
    item: NotificationBubbleItem;
}

export const NotificationDefaultBubbleView: FC<NotificationDefaultBubbleViewProps> = (props) => {
    const { item = null, onClose = null, ...rest } = props;

    const htmlText = item.message.replace(/\r\n|\r|\n/g, '<br />');

    return (
        <NativeTextTree>
            <NotificationItemLayoutView
                iconUrl={getBubbleIcon(item.notificationType, item.iconUrl)}
                onClick={() => OpenUrl(getBubbleLink(item.notificationType, item.linkUrl))}
                onClose={onClose}
                {...rest}
            >
                <span dangerouslySetInnerHTML={{ __html: SanitizeHtml(htmlText) }} />
            </NotificationItemLayoutView>
        </NativeTextTree>
    );
};
15Sujets
1Dépôts
20Membres
3En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser