5180 fichiers 38.5 Mo 0 téléchargements 474 vues mis à jour il y a 7 heures ui
bubbleDefaults.ts 1.6 Ko Télécharger le fichier
import { NotificationBubbleType } from '../../../../api';
import earningIcon from '../../../../assets/images/notifications/types/earning.png';
import clubIcon from '../../../../assets/images/notifications/types/hc.png';
import ltdIcon from '../../../../assets/images/notifications/types/ltd.png';
import recyclerIcon from '../../../../assets/images/notifications/types/recycler.png';
import infoIcon from '../../../../assets/images/notifications/types/temp.png';
import vipIcon from '../../../../assets/images/notifications/types/vip.png';

/* What the official habbo_notifications_config gives a bubble style when the server sends no
   icon or link of its own. */
const DEFAULT_ICONS: Record<string, string> = {
    [NotificationBubbleType.INFO]: infoIcon,
    [NotificationBubbleType.CLUB]: clubIcon,
    [NotificationBubbleType.VIP]: vipIcon,
    [NotificationBubbleType.RECYCLEROK]: recyclerIcon,
    [NotificationBubbleType.LTD]: ltdIcon,
    [NotificationBubbleType.EARNING]: earningIcon
};

const DEFAULT_LINKS: Record<string, string> = {
    [NotificationBubbleType.PETLEVEL]: 'inventory/show/pets',
    [NotificationBubbleType.FRIENDOFFLINE]: 'friends/show',
    [NotificationBubbleType.THIRDPARTYFRIENDONLINE]: 'friends/show',
    [NotificationBubbleType.THIRDPARTYFRIENDOFFLINE]: 'friends/show'
};

export const getBubbleIcon = (type: string, iconUrl: string | null): string | null => iconUrl ?? DEFAULT_ICONS[type] ?? null;

export const getBubbleLink = (type: string, linkUrl: string | null): string | null => (linkUrl && linkUrl.length ? linkUrl : (DEFAULT_LINKS[type] ?? null));
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