mirror of
https://github.com/duckietm/Nitro-Cool-UI.git
synced 2025-06-21 22:36:58 +00:00
Revert "🆙 Small fix for Purse"
This reverts commit c3bc077d46813b2ce31ac519a1ad70c6ef5c9125.
This commit is contained in:
parent
c3bc077d46
commit
490e2606ff
@ -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<SeasonalViewProps> = props => {
|
||||
export const SeasonalView: FC<SeasonalViewProps> = props =>
|
||||
{
|
||||
const { type = -1, amount = -1 } = props;
|
||||
|
||||
return (
|
||||
<Flex fullWidth justifyContent="between" className={`nitro-purse-seasonal-currency nitro-notification ${GetConfiguration<boolean>('currency.seasonal.color')}`} >
|
||||
<Flex fullWidth justifyContent="between" className={ 'nitro-purse-seasonal-currency nitro-notification ' + GetConfiguration<boolean>('currency.seasonal.color') }>
|
||||
<Flex fullWidth>
|
||||
<Text bold truncate fullWidth variant="white" className="seasonal-padding seasonal-bold" >
|
||||
{LocalizeText(`purse.seasonal.currency.${type}`)}
|
||||
</Text>
|
||||
<Text bold truncate variant="white" className="seasonal-amount text-end" title={amount > 99999 ? LocalizeFormattedNumber(amount) : '' } >
|
||||
{amount > 99999 ? '99 999' : LocalizeFormattedNumber(amount)}
|
||||
</Text>
|
||||
<Text bold truncate fullWidth variant="white" className="seasonal-padding seasonal-bold">{ LocalizeText(`purse.seasonal.currency.${ type }`) }</Text>
|
||||
<Text bold truncate variant="white" className="seasonal-amount text-end" title={ amount > 99999 ? LocalizeFormattedNumber(amount) : '' }>{ amount > 99999 ? '99 999' : LocalizeFormattedNumber(amount) }</Text>
|
||||
<Flex className="nitro-seasonal-box seasonal-padding">
|
||||
<LayoutCurrencyIcon type={ type } />
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
interface SeasonalCurrenciesViewProps {
|
||||
currencies: { type: number; amount: number }[];
|
||||
}
|
||||
|
||||
export const SeasonalCurrenciesView: FC<SeasonalCurrenciesViewProps> = 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 (
|
||||
<Flex column gap={2}>
|
||||
{
|
||||
sortedCurrencies.map(currency => (<SeasonalView key={currency.type} type={currency.type} amount={currency.amount} />))
|
||||
}
|
||||
</Flex>
|
||||
);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user