5180 fichiers 38.5 Mo 0 téléchargements 474 vues mis à jour il y a 7 heures ui
GetBubbleLayout.tsx 1.9 Ko Télécharger le fichier
import { MentionNotificationBubbleItem, NotificationBubbleItem, NotificationBubbleType } from '../../../../api';
import { NotificationBadgeReceivedBubbleView } from './NotificationBadgeReceivedBubbleView';
import { NotificationCaptionBubbleView } from './NotificationCaptionBubbleView';
import { NotificationClubGiftBubbleView } from './NotificationClubGiftBubbleView';
import { NotificationDefaultBubbleView } from './NotificationDefaultBubbleView';
import { NotificationFriendOnlineBubbleView } from './NotificationFriendOnlineBubbleView';
import { NotificationMentionBubbleView } from './NotificationMentionBubbleView';
import { NotificationSoundboardBubbleView } from './NotificationSoundboardBubbleView';

export const GetBubbleLayout = (item: NotificationBubbleItem, onClose: () => void) => {
    if (!item) return null;

    const props = { item, onClose };

    switch (item.notificationType) {
        case NotificationBubbleType.ACHIEVEMENT:
        case NotificationBubbleType.BADGE_RECEIVED:
            return <NotificationBadgeReceivedBubbleView key={item.id} {...props} />;
        case NotificationBubbleType.WIRED:
        case NotificationBubbleType.TREASURE_HUNT:
        case NotificationBubbleType.NFT_OPENING:
            return <NotificationCaptionBubbleView key={item.id} {...props} />;
        case NotificationBubbleType.CLUBGIFT:
            return <NotificationClubGiftBubbleView key={item.id} {...props} />;
        case NotificationBubbleType.FRIENDONLINE:
            return <NotificationFriendOnlineBubbleView key={item.id} {...props} />;
        case NotificationBubbleType.SOUNDBOARD:
            return <NotificationSoundboardBubbleView key={item.id} {...props} />;
        case NotificationBubbleType.MENTION:
            return <NotificationMentionBubbleView key={item.id} item={item as MentionNotificationBubbleItem} onClose={onClose} />;
        default:
            return <NotificationDefaultBubbleView key={item.id} {...props} />;
    }
};
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