mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 06:40:50 +01:00
Adding code for the animated badges
This commit is contained in:
parent
2fa3662860
commit
24ed62ec63
@ -1,4 +1,4 @@
|
|||||||
import { BadgeImageReadyEvent, NitroSprite, TextureUtils } from '@nitrots/nitro-renderer';
|
import { BadgeImageReadyEvent, Nitro, NitroSprite, TextureUtils } from '@nitrots/nitro-renderer';
|
||||||
import { CSSProperties, FC, useEffect, useMemo, useState } from 'react';
|
import { CSSProperties, FC, useEffect, useMemo, useState } from 'react';
|
||||||
import { GetConfiguration, GetSessionDataManager, LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../api';
|
import { GetConfiguration, GetSessionDataManager, LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../api';
|
||||||
import { Base, BaseProps } from '../Base';
|
import { Base, BaseProps } from '../Base';
|
||||||
@ -37,7 +37,7 @@ export const LayoutBadgeImageView: FC<LayoutBadgeImageViewProps> = props =>
|
|||||||
|
|
||||||
if(imageElement)
|
if(imageElement)
|
||||||
{
|
{
|
||||||
newStyle.backgroundImage = `url('${ imageElement.src }')`;
|
newStyle.backgroundImage = (isGroup || isGrayscale) ? imageElement.src : `url(${ Nitro.instance.getConfiguration<string>('badge.asset.url').replace('%badgename%', badgeCode.toString()) })`;
|
||||||
newStyle.width = imageElement.width;
|
newStyle.width = imageElement.width;
|
||||||
newStyle.height = imageElement.height;
|
newStyle.height = imageElement.height;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user