Skip to content

Commit

Permalink
i18n-costcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
xudaotutou committed Nov 28, 2024
1 parent 76c93a6 commit 8ce6bc4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ export default function CurrencySymbol({
return type === 'shellCoin' ? (
<Img src={sealosCoin.src} boxSize={'16px'} maxW={'unset'} {...props}></Img>
) : type === 'cny' ? (
<Text {...props}></Text>
<Text {...props} boxSize={'auto'}>
</Text>
) : (
<Text {...props}>$</Text>
<Text {...props} boxSize={'auto'}>
$
</Text>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const BonusBox = (props: {
<Text>{t('Double')}!</Text>
<Flex align={'center'}>
+
<CurrencySymbol boxSize={'10px'} mr={'2px'} />
<CurrencySymbol boxSize={'10px'} mr={'2px'} type={currency} />
<Text>{props.bouns}</Text>
</Flex>
</Flex>
Expand All @@ -213,7 +213,7 @@ const BonusBox = (props: {
fontSize="12px"
>
<Text mr="4px">{t('Bonus')}</Text>
<CurrencySymbol boxSize={'10px'} mr={'2px'} />
<CurrencySymbol boxSize={'10px'} mr={'2px'} type={currency} />
<Text> {props.bouns}</Text>
</Flex>
)}
Expand Down Expand Up @@ -536,7 +536,7 @@ const RechargeModal = forwardRef(
>
{t('Bonus')} {getBonus(amount)}
</Text>
<CurrencySymbol boxSize={'10px'} />
<CurrencySymbol boxSize={'10px'} type={currency} />
</Flex>
<Flex
alignSelf={'flex-start'}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useQuery } from '@tanstack/react-query';
import CurrencySymbol from '@/components/CurrencySymbol';
import request from '@/service/request';
import useBillingStore from '@/stores/billing';
import useEnvStore from '@/stores/env';
import useOverviewStore from '@/stores/overview';
import { formatMoney } from '@/utils/format';
import { Box, Flex, Text } from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query';
import { useTranslation } from 'next-i18next';
import { Text, Box, Flex } from '@chakra-ui/react';
import CurrencySymbol from '@/components/CurrencySymbol';
import useOverviewStore from '@/stores/overview';
import useBillingStore from '@/stores/billing';
import { useMemo } from 'react';

export default function AmountDisplay({ onlyOut = false }: { onlyOut?: boolean }) {
Expand Down Expand Up @@ -54,13 +55,14 @@ export default function AmountDisplay({ onlyOut = false }: { onlyOut?: boolean }
return list;
}, [onlyOut, rechargeData, expenditureData]);
const { t } = useTranslation();
const { currency } = useEnvStore();
return (
<Flex gap={'32px'}>
{list.map((item) => (
<Flex align={'center'} gap={'8px'} fontSize={'12px'} key={item.title}>
<Box w="8px" h="8px" bgColor={item.bgColor} borderRadius={'2px'} />
<Text>{t(item.title)}: </Text>
<CurrencySymbol fontSize={'14px'} />
<CurrencySymbol fontSize={'14px'} type={currency} />
<Text>{formatMoney(item.value).toFixed(2)}</Text>
</Flex>
))}
Expand Down

0 comments on commit 8ce6bc4

Please sign in to comment.