diff options
author | Eric Bailey <git@esb.lol> | 2024-08-29 19:22:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-29 19:22:53 -0500 |
commit | 8651f31ebb7cf9c6a0949503f2c2c5755328ce46 (patch) | |
tree | 04f9c08a3770cee554a6cd421a53dc04957457fb /src/view/shell/Drawer.tsx | |
parent | d5a76183746bc67f88b858add49c2dba52b99bb5 (diff) | |
download | voidsky-8651f31ebb7cf9c6a0949503f2c2c5755328ce46.tar.zst |
Localize dates, counts (#5027)
* refactor: consistent localized formatting * refactor: localized date time * refactor: localize relative time with strings * chore: fix typo from copy-paste * Clean up useTimeAgo * Remove old ago * Const * Reuse * Prettier --------- Co-authored-by: Mary <git@mary.my.id>
Diffstat (limited to 'src/view/shell/Drawer.tsx')
-rw-r--r-- | src/view/shell/Drawer.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 0e852edd1..facead2c1 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -30,7 +30,7 @@ import {colors, s} from 'lib/styles' import {useTheme} from 'lib/ThemeContext' import {isWeb} from 'platform/detection' import {NavSignupCard} from '#/view/shell/NavSignupCard' -import {formatCountShortOnly} from 'view/com/util/numeric/format' +import {formatCount} from 'view/com/util/numeric/format' import {Text} from 'view/com/util/text/Text' import {UserAvatar} from 'view/com/util/UserAvatar' import {atoms as a} from '#/alf' @@ -68,7 +68,7 @@ let DrawerProfileCard = ({ account: SessionAccount onPressProfile: () => void }): React.ReactNode => { - const {_} = useLingui() + const {_, i18n} = useLingui() const pal = usePalette('default') const {data: profile} = useProfileQuery({did: account.did}) @@ -108,7 +108,7 @@ let DrawerProfileCard = ({ <Text type="xl" style={pal.textLight}> <Trans> <Text type="xl-medium" style={pal.text}> - {formatCountShortOnly(profile?.followersCount ?? 0)} + {formatCount(i18n, profile?.followersCount ?? 0)} </Text>{' '} <Plural value={profile?.followersCount || 0} @@ -123,7 +123,7 @@ let DrawerProfileCard = ({ <Text type="xl" style={pal.textLight}> <Trans> <Text type="xl-medium" style={pal.text}> - {formatCountShortOnly(profile?.followsCount ?? 0)} + {formatCount(i18n, profile?.followsCount ?? 0)} </Text>{' '} <Plural value={profile?.followsCount || 0} |