From 9d1590c74c2e729fdd8b61e87a63159fb655b6f7 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 24 Jul 2021 04:03:46 -0400 Subject: [PATCH] Purse updates --- src/views/purse/PurseMessageHandler.tsx | 66 +++---- src/views/purse/PurseView.scss | 6 +- src/views/purse/PurseView.tsx | 133 ++++++++++---- src/views/purse/PurseView.types.ts | 4 - src/views/purse/common/CurrencyHelper.ts | 21 +-- src/views/purse/common/IPurse.ts | 17 ++ src/views/purse/common/Purse.ts | 163 ++++++++++++++++++ src/views/purse/context/PurseContext.tsx | 3 +- src/views/purse/context/PurseContext.types.ts | 7 +- .../purse/currency/CurrencyView.types.ts | 6 - src/views/purse/reducers/PurseReducer.tsx | 77 --------- .../purse/seasonal/SeasonalView.types.ts | 6 - .../{ => views}/currency/CurrencyView.scss | 0 .../{ => views}/currency/CurrencyView.tsx | 14 +- .../currency/CurrencyView.types.ts} | 2 +- src/views/purse/views/index.scss | 2 + .../{ => views}/seasonal/SeasonalView.scss | 0 .../{ => views}/seasonal/SeasonalView.tsx | 14 +- .../views/seasonal/SeasonalView.types.ts | 6 + src/views/right-side/RightSideView.scss | 2 +- 20 files changed, 344 insertions(+), 205 deletions(-) delete mode 100644 src/views/purse/PurseView.types.ts create mode 100644 src/views/purse/common/IPurse.ts create mode 100644 src/views/purse/common/Purse.ts delete mode 100644 src/views/purse/currency/CurrencyView.types.ts delete mode 100644 src/views/purse/reducers/PurseReducer.tsx delete mode 100644 src/views/purse/seasonal/SeasonalView.types.ts rename src/views/purse/{ => views}/currency/CurrencyView.scss (100%) rename src/views/purse/{ => views}/currency/CurrencyView.tsx (54%) rename src/views/purse/{common/Currency.ts => views/currency/CurrencyView.types.ts} (54%) create mode 100644 src/views/purse/views/index.scss rename src/views/purse/{ => views}/seasonal/SeasonalView.scss (100%) rename src/views/purse/{ => views}/seasonal/SeasonalView.tsx (56%) create mode 100644 src/views/purse/views/seasonal/SeasonalView.types.ts diff --git a/src/views/purse/PurseMessageHandler.tsx b/src/views/purse/PurseMessageHandler.tsx index 23d474e2..acab48c5 100644 --- a/src/views/purse/PurseMessageHandler.tsx +++ b/src/views/purse/PurseMessageHandler.tsx @@ -1,69 +1,59 @@ -import { UserCreditsEvent, UserCurrencyEvent, UserCurrencyUpdateEvent, UserSubscriptionEvent } from 'nitro-renderer'; +import { UserCreditsEvent, UserCurrencyEvent, UserCurrencyUpdateEvent, UserSubscriptionEvent, UserSubscriptionParser } from 'nitro-renderer'; import { FC, useCallback } from 'react'; import { CreateMessageHook } from '../../hooks/messages/message-event'; -import { Currency } from './common/Currency'; import { usePurseContext } from './context/PurseContext'; import { PurseMessageHandlerProps } from './PurseMessageHandler.types'; -import { PurseActions } from './reducers/PurseReducer'; export const PurseMessageHandler: FC = props => { - const { dispatchPurseState = null } = usePurseContext(); + const { purse = null } = usePurseContext(); const onUserCreditsEvent = useCallback((event: UserCreditsEvent) => { const parser = event.getParser(); - dispatchPurseState({ - type: PurseActions.SET_CURRENCY, - payload: { - currency: { type: -1, amount: parseFloat(parser.credits) } - } - }); - }, [ dispatchPurseState ]); + purse.credits = parseFloat(parser.credits); + + purse.notify(); + }, [ purse ]); const onUserCurrencyEvent = useCallback((event: UserCurrencyEvent) => { const parser = event.getParser(); - const currencies: Currency[] = []; + purse.activityPoints = parser.currencies; - for(const [ key, value ] of parser.currencies.entries()) currencies.push({ type: key, amount: value }); - - dispatchPurseState({ - type: PurseActions.SET_CURRENCIES, - payload: { currencies } - }); - }, [ dispatchPurseState ]); + purse.notify(); + }, [ purse ]); const onUserCurrencyUpdateEvent = useCallback((event: UserCurrencyUpdateEvent) => { const parser = event.getParser(); - dispatchPurseState({ - type: PurseActions.SET_CURRENCY, - payload: { - currency: { type: parser.type, amount: parser.amount } - } - }); - }, [ dispatchPurseState ]); + purse.activityPoints.set(parser.type, parser.amount); + + purse.notify(); + }, [ purse ]); const onUserSubscriptionEvent = useCallback((event: UserSubscriptionEvent) => { const parser = event.getParser(); - switch(parser.name) - { - case 'habbo_club': - dispatchPurseState({ - type: PurseActions.SET_CLUB_SUBSCRIPTION, - payload: { - clubSubscription: parser - } - }); - return; - } - }, [ dispatchPurseState ]); + const productName = parser.productName; + + if((productName !== 'club_habbo') && (productName !== 'habbo_club')) return; + + purse.clubDays = Math.max(0, parser.daysToPeriodEnd); + purse.clubPeriods = Math.max(0, parser.periodsSubscribedAhead); + purse.isVip = parser.isVip; + purse.pastClubDays = parser.pastClubDays; + purse.pastVipDays = parser.pastVipDays; + purse.isExpiring = ((parser.responseType === UserSubscriptionParser.RESPONSE_TYPE_DISCOUNT_AVAILABLE) ? true : false); + purse.minutesUntilExpiration = parser.minutesUntilExpiration; + purse.minutesSinceLastModified = parser.minutesSinceLastModified; + + purse.notify(); + }, [ purse ]); CreateMessageHook(UserCreditsEvent, onUserCreditsEvent); CreateMessageHook(UserCurrencyEvent, onUserCurrencyEvent); diff --git a/src/views/purse/PurseView.scss b/src/views/purse/PurseView.scss index d51789b4..82ea9cc3 100644 --- a/src/views/purse/PurseView.scss +++ b/src/views/purse/PurseView.scss @@ -2,9 +2,8 @@ padding: 2px; background-color: #1c323f; border: 2px solid rgba($white, 0.5); - border-top:0; + border-top: 0; font-size: $font-size-sm; - z-index: $context-menu-zindex; pointer-events: all; margin-bottom:5px; @@ -35,5 +34,4 @@ } } -@import './currency/CurrencyView'; -@import './seasonal/SeasonalView'; +@import './views'; diff --git a/src/views/purse/PurseView.tsx b/src/views/purse/PurseView.tsx index 435ce2a3..ac041dbc 100644 --- a/src/views/purse/PurseView.tsx +++ b/src/views/purse/PurseView.tsx @@ -1,62 +1,130 @@ -import { UserCurrencyComposer } from 'nitro-renderer'; -import { FC, useCallback, useEffect, useMemo, useReducer } from 'react'; +import { FriendlyTime, HabboClubLevelEnum, UserCurrencyComposer, UserSubscriptionComposer } from 'nitro-renderer'; +import { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { GetConfiguration } from '../../api'; -import { NotificationCenterEvent } from '../../events'; -import { dispatchUiEvent } from '../../hooks/events'; import { SendMessageHook } from '../../hooks/messages/message-event'; import { LocalizeText } from '../../utils/LocalizeText'; import { CurrencyIcon } from '../shared/currency-icon/CurrencyIcon'; -import { SetLastCurrencies } from './common/CurrencyHelper'; +import { IPurse } from './common/IPurse'; +import { Purse } from './common/Purse'; import { PurseContextProvider } from './context/PurseContext'; -import { CurrencyView } from './currency/CurrencyView'; import { PurseMessageHandler } from './PurseMessageHandler'; -import { PurseViewProps } from './PurseView.types'; -import { initialPurse, PurseReducer } from './reducers/PurseReducer'; -import { SeasonalView } from './seasonal/SeasonalView'; +import { CurrencyView } from './views/currency/CurrencyView'; +import { SeasonalView } from './views/seasonal/SeasonalView'; -export const PurseView: FC = props => +export let GLOBAL_PURSE: IPurse = null; + +export const PurseView: FC<{}> = props => { - const [ purseState, dispatchPurseState ] = useReducer(PurseReducer, initialPurse); - const { currencies = [] } = purseState; + const [ purse, setPurse ] = useState(new Purse()); + const [ updateId, setUpdateId ] = useState(-1); const displayedCurrencies = useMemo(() => { return GetConfiguration('system.currency.types', []); }, []); + const getCurrencyElements = useCallback((offset: number, limit: number = -1, seasonal: boolean = false) => + { + if(!purse.activityPoints.size) return null; + + const types = Array.from(purse.activityPoints.keys()).filter(type => (displayedCurrencies.indexOf(type) >= 0)); + + let count = 0; + + while(count < offset) + { + types.shift(); + + count++; + } + + count = 0; + + const elements: JSX.Element[] = []; + + for(const type of types) + { + if((limit > -1) && (count === limit)) break; + + if(seasonal) elements.push(); + else elements.push(); + + count++; + } + + return elements; + }, [ purse, displayedCurrencies ]); + + const getClubText = useCallback(() => + { + const totalDays = ((purse.clubPeriods * 31) + purse.clubDays); + const minutesUntilExpiration = purse.minutesUntilExpiration; + + if(purse.clubLevel === HabboClubLevelEnum.NO_CLUB) + { + return LocalizeText('purse.clubdays.zero.amount.text'); + } + + else if((minutesUntilExpiration > -1) && (minutesUntilExpiration < (60 * 24))) + { + return FriendlyTime.shortFormat(minutesUntilExpiration * 60); + } + + else + { + return FriendlyTime.shortFormat(totalDays * 86400); + } + }, [ purse ]); + useEffect(() => { - SendMessageHook(new UserCurrencyComposer()); + const purse = new Purse(); + + GLOBAL_PURSE = purse; + + purse.notifier = () => setUpdateId(prevValue => (prevValue + 1)); + + setPurse(purse); + + return () => (purse.notifier = null); }, []); - SetLastCurrencies(currencies); - - const toggleNotificationCenter = useCallback(() => + useEffect(() => { - dispatchUiEvent(new NotificationCenterEvent(NotificationCenterEvent.TOGGLE_NOTIFICATION_CENTER)); - }, []); + if(!purse) return; + + SendMessageHook(new UserCurrencyComposer()); + }, [ purse ]); + + useEffect(() => + { + SendMessageHook(new UserSubscriptionComposer('habbo_club')); + + const interval = setInterval(() => + { + SendMessageHook(new UserSubscriptionComposer('habbo_club')); + }, 50000); + + return () => clearInterval(interval); + }, [ purse ]); + + if(!purse) return null; return ( - +
- { currencies && currencies.map((currency, index) => - { - if (displayedCurrencies.indexOf(currency.type) === -1) return null; - - if (currency.type === -1 || currency.type === 0 || currency.type === 5) return ; - - return null; - })} + + { getCurrencyElements(0, 2) }
- {LocalizeText('purse.clubdays.zero.amount.text')} + { getClubText() }
@@ -70,14 +138,7 @@ export const PurseView: FC = props =>
*/}
- { currencies && currencies.map((currency, index) => - { - if (displayedCurrencies.indexOf(currency.type) === -1) return null; - - if (currency.type === -1 || currency.type === 0 || currency.type === 5) return null; - - return ; - })} + { getCurrencyElements(2, -1, true) } ); } diff --git a/src/views/purse/PurseView.types.ts b/src/views/purse/PurseView.types.ts deleted file mode 100644 index c6fdd024..00000000 --- a/src/views/purse/PurseView.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface PurseViewProps -{ - -} diff --git a/src/views/purse/common/CurrencyHelper.ts b/src/views/purse/common/CurrencyHelper.ts index 6f382a9b..f9a6c3dd 100644 --- a/src/views/purse/common/CurrencyHelper.ts +++ b/src/views/purse/common/CurrencyHelper.ts @@ -1,19 +1,16 @@ -import { Currency } from './Currency'; - -let lastCurrencies: Currency[] = []; - -export function SetLastCurrencies(currencies: Currency[]): void -{ - lastCurrencies = currencies; -} +import { GLOBAL_PURSE } from '../PurseView'; export function GetCurrencyAmount(type: number): number { - for(const currency of lastCurrencies) - { - if(currency.type !== type) continue; + const purse = GLOBAL_PURSE; - return currency.amount; + if(type === -1) return purse.credits; + + for(const [ key, value ] of purse.activityPoints.entries()) + { + if(key !== type) continue; + + return value; } return 0; diff --git a/src/views/purse/common/IPurse.ts b/src/views/purse/common/IPurse.ts new file mode 100644 index 00000000..2a709938 --- /dev/null +++ b/src/views/purse/common/IPurse.ts @@ -0,0 +1,17 @@ +export interface IPurse +{ + credits: number; + activityPoints: Map; + clubDays: number; + clubPeriods: number; + _Str_13571: boolean; + isVip: boolean; + pastClubDays: number; + pastVipDays: number; + isExpiring: boolean; + minutesUntilExpiration: number; + minutesSinceLastModified: number; + clubLevel: number; + notifier: () => void + notify(): void; +} diff --git a/src/views/purse/common/Purse.ts b/src/views/purse/common/Purse.ts new file mode 100644 index 00000000..63bb2111 --- /dev/null +++ b/src/views/purse/common/Purse.ts @@ -0,0 +1,163 @@ +import { HabboClubLevelEnum } from 'nitro-renderer'; +import { GetNitroInstance } from '../../../api'; +import { IPurse } from './IPurse'; + +export class Purse implements IPurse +{ + private _credits: number = 0; + private _activityPoints: Map = new Map(); + private _clubDays: number = 0; + private _clubPeriods: number = 0; + private _isVIP: boolean = false; + private _pastClubDays: number = 0; + private _pastVipDays: number = 0; + private _isExpiring: boolean = false; + private _minutesUntilExpiration: number = 0; + private _minutesSinceLastModified: number; + private _lastUpdated: number; + private _notifier: () => void; + + public get credits(): number + { + return this._credits; + } + + public set credits(credits: number) + { + this._lastUpdated = GetNitroInstance().time; + this._credits = credits; + } + + public get activityPoints(): Map + { + return this._activityPoints; + } + + public set activityPoints(k: Map) + { + this._lastUpdated = GetNitroInstance().time; + this._activityPoints = k; + } + + public get clubDays(): number + { + return this._clubDays; + } + + public set clubDays(k: number) + { + this._lastUpdated = GetNitroInstance().time; + this._clubDays = k; + } + + public get clubPeriods(): number + { + return this._clubPeriods; + } + + public set clubPeriods(k: number) + { + this._lastUpdated = GetNitroInstance().time; + this._clubPeriods = k; + } + + public get _Str_13571(): boolean + { + return (this._clubDays > 0) || (this._clubPeriods > 0); + } + + public get isVip(): boolean + { + return this._isVIP; + } + + public set isVip(k: boolean) + { + this._isVIP = k; + } + + public get pastClubDays(): number + { + return this._pastClubDays; + } + + public set pastClubDays(k: number) + { + this._lastUpdated = GetNitroInstance().time; + this._pastClubDays = k; + } + + public get pastVipDays(): number + { + return this._pastVipDays; + } + + public set pastVipDays(k: number) + { + this._lastUpdated = GetNitroInstance().time; + this._pastVipDays = k; + } + + public get isExpiring(): boolean + { + return this._isExpiring; + } + + public set isExpiring(k: boolean) + { + this._isExpiring = k; + } + + public get minutesUntilExpiration(): number + { + var k: number = ((GetNitroInstance().time - this._lastUpdated) / (1000 * 60)); + var _local_2: number = (this._minutesUntilExpiration - k); + return (_local_2 > 0) ? _local_2 : 0; + } + + public set minutesUntilExpiration(k: number) + { + this._lastUpdated = GetNitroInstance().time; + this._minutesUntilExpiration = k; + } + + public get minutesSinceLastModified(): number + { + return this._minutesSinceLastModified; + } + + public set minutesSinceLastModified(k: number) + { + this._lastUpdated = GetNitroInstance().time; + this._minutesSinceLastModified = k; + } + + public get lastUpdated(): number + { + return this._lastUpdated; + } + + public get notifier(): () => void + { + return this._notifier; + } + + public set notifier(notifier: () => void) + { + this._notifier = notifier; + } + + public get clubLevel(): number + { + if(((this.clubDays === 0) && (this.clubPeriods === 0))) return HabboClubLevelEnum.NO_CLUB; + + if (this.isVip) return HabboClubLevelEnum.VIP; + + return HabboClubLevelEnum.CLUB; + } + + public notify(): void + { + if(this._notifier) this._notifier(); + } +} diff --git a/src/views/purse/context/PurseContext.tsx b/src/views/purse/context/PurseContext.tsx index 788d4d8d..b843f42c 100644 --- a/src/views/purse/context/PurseContext.tsx +++ b/src/views/purse/context/PurseContext.tsx @@ -2,8 +2,7 @@ import { createContext, FC, useContext } from 'react'; import { IPurseContext, PurseContextProps } from './PurseContext.types'; const PurseContext = createContext({ - purseState: null, - dispatchPurseState: null + purse: null }); export const PurseContextProvider: FC = props => diff --git a/src/views/purse/context/PurseContext.types.ts b/src/views/purse/context/PurseContext.types.ts index 4b18f160..7470b465 100644 --- a/src/views/purse/context/PurseContext.types.ts +++ b/src/views/purse/context/PurseContext.types.ts @@ -1,10 +1,9 @@ -import { Dispatch, ProviderProps } from 'react'; -import { IPurseAction, IPurseState } from '../reducers/PurseReducer'; +import { ProviderProps } from 'react'; +import { IPurse } from '../common/IPurse'; export interface IPurseContext { - purseState: IPurseState; - dispatchPurseState: Dispatch; + purse: IPurse; } export interface PurseContextProps extends ProviderProps diff --git a/src/views/purse/currency/CurrencyView.types.ts b/src/views/purse/currency/CurrencyView.types.ts deleted file mode 100644 index aa58250d..00000000 --- a/src/views/purse/currency/CurrencyView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Currency } from '../common/Currency'; - -export interface CurrencyViewProps -{ - currency: Currency; -} diff --git a/src/views/purse/reducers/PurseReducer.tsx b/src/views/purse/reducers/PurseReducer.tsx deleted file mode 100644 index 3e9d5f5b..00000000 --- a/src/views/purse/reducers/PurseReducer.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { UserSubscriptionParser } from 'nitro-renderer'; -import { Reducer } from 'react'; -import { Currency } from '../common/Currency'; - -export interface IPurseState -{ - currencies: Currency[]; - clubSubscription: UserSubscriptionParser; -} - -export interface IPurseAction -{ - type: string; - payload: { - currency?: Currency; - currencies?: Currency[]; - clubSubscription?: UserSubscriptionParser; - } -} - -export class PurseActions -{ - public static SET_CURRENCY: string = 'PA_SET_CURRENCY'; - public static SET_CURRENCIES: string = 'PA_SET_CURRENCIES'; - public static SET_CLUB_SUBSCRIPTION: string = 'PA_SET_CLUB_SUBSCRIPTION'; -} - -export const initialPurse: IPurseState = { - currencies: [], - clubSubscription: null -} - -export const PurseReducer: Reducer = (state, action) => -{ - switch(action.type) - { - case PurseActions.SET_CURRENCY: { - const updated = action.payload.currency; - - let didSet = false; - - const currencies = state.currencies.map(existing => - { - if(existing.type !== updated.type) return existing; - - didSet = true; - - return { ...updated }; - }); - - if(!didSet) currencies.push({ ...updated }); - - return { ...state, currencies }; - } - case PurseActions.SET_CURRENCIES: { - const updated = action.payload.currencies; - - const currencies = state.currencies.filter(existing => - { - if(existing.type !== -1) return null; - - return existing; - }); - - if(updated && updated.length) currencies.push(...updated); - - return { ...state, currencies }; - } - case PurseActions.SET_CLUB_SUBSCRIPTION: { - const clubSubscription = action.payload.clubSubscription; - - return { ...state, clubSubscription }; - } - default: - return state; - } -} diff --git a/src/views/purse/seasonal/SeasonalView.types.ts b/src/views/purse/seasonal/SeasonalView.types.ts deleted file mode 100644 index b6c2b3a5..00000000 --- a/src/views/purse/seasonal/SeasonalView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Currency } from '../common/Currency'; - -export interface SeasonalViewProps -{ - currency: Currency; -} diff --git a/src/views/purse/currency/CurrencyView.scss b/src/views/purse/views/currency/CurrencyView.scss similarity index 100% rename from src/views/purse/currency/CurrencyView.scss rename to src/views/purse/views/currency/CurrencyView.scss diff --git a/src/views/purse/currency/CurrencyView.tsx b/src/views/purse/views/currency/CurrencyView.tsx similarity index 54% rename from src/views/purse/currency/CurrencyView.tsx rename to src/views/purse/views/currency/CurrencyView.tsx index 87016ebc..32c06007 100644 --- a/src/views/purse/currency/CurrencyView.tsx +++ b/src/views/purse/views/currency/CurrencyView.tsx @@ -1,24 +1,24 @@ import { FC } from 'react'; import { OverlayTrigger, Tooltip } from 'react-bootstrap'; -import { LocalizeShortNumber } from '../../../utils/LocalizeShortNumber'; -import { CurrencyIcon } from '../../shared/currency-icon/CurrencyIcon'; +import { LocalizeShortNumber } from '../../../../utils/LocalizeShortNumber'; +import { CurrencyIcon } from '../../../shared/currency-icon/CurrencyIcon'; import { CurrencyViewProps } from './CurrencyView.types'; export const CurrencyView: FC = props => { - const { currency = null } = props; + const { type = -1, amount = -1 } = props; return ( - { currency.amount } + + { amount } }>
-
{LocalizeShortNumber(currency.amount)}
- +
{LocalizeShortNumber(amount)}
+
); diff --git a/src/views/purse/common/Currency.ts b/src/views/purse/views/currency/CurrencyView.types.ts similarity index 54% rename from src/views/purse/common/Currency.ts rename to src/views/purse/views/currency/CurrencyView.types.ts index 9a2e2dea..0ff2718e 100644 --- a/src/views/purse/common/Currency.ts +++ b/src/views/purse/views/currency/CurrencyView.types.ts @@ -1,4 +1,4 @@ -export interface Currency +export interface CurrencyViewProps { type: number; amount: number; diff --git a/src/views/purse/views/index.scss b/src/views/purse/views/index.scss new file mode 100644 index 00000000..20184d7b --- /dev/null +++ b/src/views/purse/views/index.scss @@ -0,0 +1,2 @@ +@import './currency/CurrencyView'; +@import './seasonal/SeasonalView'; diff --git a/src/views/purse/seasonal/SeasonalView.scss b/src/views/purse/views/seasonal/SeasonalView.scss similarity index 100% rename from src/views/purse/seasonal/SeasonalView.scss rename to src/views/purse/views/seasonal/SeasonalView.scss diff --git a/src/views/purse/seasonal/SeasonalView.tsx b/src/views/purse/views/seasonal/SeasonalView.tsx similarity index 56% rename from src/views/purse/seasonal/SeasonalView.tsx rename to src/views/purse/views/seasonal/SeasonalView.tsx index 0edf2c19..4bad9ab5 100644 --- a/src/views/purse/seasonal/SeasonalView.tsx +++ b/src/views/purse/views/seasonal/SeasonalView.tsx @@ -1,21 +1,21 @@ import { FC } from 'react'; -import { LocalizeShortNumber } from '../../../utils/LocalizeShortNumber'; -import { LocalizeText } from '../../../utils/LocalizeText'; -import { CurrencyIcon } from '../../shared/currency-icon/CurrencyIcon'; +import { LocalizeShortNumber } from '../../../../utils/LocalizeShortNumber'; +import { LocalizeText } from '../../../../utils/LocalizeText'; +import { CurrencyIcon } from '../../../shared/currency-icon/CurrencyIcon'; import { SeasonalViewProps } from './SeasonalView.types'; export const SeasonalView: FC = props => { - const { currency = null } = props; + const { type = -1, amount = -1 } = props; return (
- { LocalizeText(`purse.seasonal.currency.${currency.type}`) } - { LocalizeShortNumber(currency.amount) } + { LocalizeText(`purse.seasonal.currency.${ type }`) } + { LocalizeShortNumber(amount) }
- +
); diff --git a/src/views/purse/views/seasonal/SeasonalView.types.ts b/src/views/purse/views/seasonal/SeasonalView.types.ts new file mode 100644 index 00000000..c7b8db5a --- /dev/null +++ b/src/views/purse/views/seasonal/SeasonalView.types.ts @@ -0,0 +1,6 @@ + +export interface SeasonalViewProps +{ + type: number; + amount: number; +} diff --git a/src/views/right-side/RightSideView.scss b/src/views/right-side/RightSideView.scss index c0fd037b..fd2c00c3 100644 --- a/src/views/right-side/RightSideView.scss +++ b/src/views/right-side/RightSideView.scss @@ -1,7 +1,7 @@ .nitro-right-side { position: absolute; top: 0px; - right: 5px; + right: 10px; min-width: 200px; max-width: 400px; z-index: $rightside-zindex;