5180 fichiers 38.5 Mo 0 téléchargements 525 vues mis à jour il y a 8 heures ui
nitro-v36-with-renderer-v36 / src / components / catalog / views / page / widgets / CatalogAddOnChatStyleWidgetView.tsx
CatalogAddOnChatStyleWidgetView.tsx 1.4 Ko Télécharger le fichier
import { FC } from 'react';
import chatStyleBackgroundSrc from '../../../../../assets/images/catalog/air/catalogue-chatstyle-background.png';
import { LayoutChatStyleImageView } from '../../../../../common';
import { NativeTextTree } from '../../../../../common/native-text/NativeTextTree';
import { useCatalogData } from '../../../../../hooks';

interface CatalogAddOnChatStyleWidgetViewProps {
    className?: string;
}

/**
 * AIR ProductViewCatalogWidget -> HabboCatalogUtils.showExtraOnProduct(CHAT_STYLE): a chat
 * style sold together with other products is shown on `catalogue_chatstyle_background`
 * next to the preview, where a bundled badge would be. A badge takes precedence.
 */
export const CatalogAddOnChatStyleWidgetView: FC<CatalogAddOnChatStyleWidgetViewProps> = (props) => {
    const { className = '' } = props;
    const { currentOffer = null } = useCatalogData();

    if (!currentOffer || currentOffer.badgeCode?.length || !currentOffer.chatStyleId?.length) return null;

    return (
        <NativeTextTree>
            <div className={`octane-catalog-addon-chat-style ${className}`.trim()}>
                <img alt="" className="octane-catalog-addon-chat-style-background" draggable={false} src={chatStyleBackgroundSrc} />
                <LayoutChatStyleImageView styleId={currentOffer.chatStyleId} />
            </div>
        </NativeTextTree>
    );
};
15Sujets
1Dépôts
20Membres
4En 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