From 490e2606ff739d3ff1b3a6ef75fbc3746b9389b1 Mon Sep 17 00:00:00 2001 From: DuckieTM Date: Sun, 9 Mar 2025 20:12:41 +0100 Subject: [PATCH] Revert ":up: Small fix for Purse" This reverts commit c3bc077d46813b2ce31ac519a1ad70c6ef5c9125. --- src/components/purse/views/SeasonalView.tsx | 45 +++++---------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/src/components/purse/views/SeasonalView.tsx b/src/components/purse/views/SeasonalView.tsx index c10bdaa..5820b1c 100644 --- a/src/components/purse/views/SeasonalView.tsx +++ b/src/components/purse/views/SeasonalView.tsx @@ -2,53 +2,26 @@ import { FC } from 'react'; import { GetConfiguration, LocalizeFormattedNumber, LocalizeText } from '../../../api'; import { Flex, LayoutCurrencyIcon, Text } from '../../../common'; -interface SeasonalViewProps { +interface SeasonalViewProps +{ type: number; amount: number; } -// Individual currency display component -export const SeasonalView: FC = props => { +export const SeasonalView: FC = props => +{ const { type = -1, amount = -1 } = props; return ( - ('currency.seasonal.color')}`} > + ('currency.seasonal.color') }> - - {LocalizeText(`purse.seasonal.currency.${type}`)} - - 99999 ? LocalizeFormattedNumber(amount) : '' } > - {amount > 99999 ? '99 999' : LocalizeFormattedNumber(amount)} - + { LocalizeText(`purse.seasonal.currency.${ type }`) } + 99999 ? LocalizeFormattedNumber(amount) : '' }>{ amount > 99999 ? '99 999' : LocalizeFormattedNumber(amount) } - + - ); -}; -interface SeasonalCurrenciesViewProps { - currencies: { type: number; amount: number }[]; + ); } - -export const SeasonalCurrenciesView: FC = props => { - const { currencies } = props; - - // Sort currencies: 0 first, then 5, then others - const sortedCurrencies = [...currencies].sort((a, b) => { - if (a.type === 0) return -1; - if (b.type === 0) return 1; - if (a.type === 5) return -1; - if (b.type === 5) return 1; - return a.type - b.type; - }); - - return ( - - { - sortedCurrencies.map(currency => ()) - } - - ); -}; \ No newline at end of file