diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-09-05 17:29:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-05 09:29:10 -0500 |
commit | 0c4b9080207b0ca35a85ffa1e4f6a67189314ac8 (patch) | |
tree | 959570602fda6123478665f0356721914781786b /src/components/PostControls/RepostButton.web.tsx | |
parent | 457cd3d0fb4074401eb4df12a5d27fd7cc1387cc (diff) | |
download | voidsky-0c4b9080207b0ca35a85ffa1e4f6a67189314ac8.tar.zst |
Simplify post number formatting (#8978)
* revert number formatting change * use formatPostStatCount in repost web
Diffstat (limited to 'src/components/PostControls/RepostButton.web.tsx')
-rw-r--r-- | src/components/PostControls/RepostButton.web.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/components/PostControls/RepostButton.web.tsx b/src/components/PostControls/RepostButton.web.tsx index e8e02d2c0..8a2a61fef 100644 --- a/src/components/PostControls/RepostButton.web.tsx +++ b/src/components/PostControls/RepostButton.web.tsx @@ -4,7 +4,6 @@ import {useLingui} from '@lingui/react' import {useRequireAuth} from '#/state/session' import {useSession} from '#/state/session' import {EventStopper} from '#/view/com/util/EventStopper' -import {formatCount} from '#/view/com/util/numeric/format' import {useTheme} from '#/alf' import {CloseQuote_Stroke2_Corner1_Rounded as Quote} from '#/components/icons/Quote' import {Repost_Stroke2_Corner2_Rounded as Repost} from '#/components/icons/Repost' @@ -14,6 +13,7 @@ import { PostControlButtonIcon, PostControlButtonText, } from './PostControlButton' +import {useFormatPostStatCount} from './util' interface Props { isReposted: boolean @@ -33,9 +33,10 @@ export const RepostButton = ({ embeddingDisabled, }: Props) => { const t = useTheme() - const {_, i18n} = useLingui() + const {_} = useLingui() const {hasSession} = useSession() const requireAuth = useRequireAuth() + const formatPostStatCount = useFormatPostStatCount() return hasSession ? ( <EventStopper onKeyDown={false}> @@ -53,7 +54,7 @@ export const RepostButton = ({ <PostControlButtonIcon icon={Repost} /> {typeof repostCount !== 'undefined' && repostCount > 0 && ( <PostControlButtonText testID="repostCount"> - {formatCount(i18n, repostCount)} + {formatPostStatCount(repostCount)} </PostControlButtonText> )} </PostControlButton> @@ -105,7 +106,7 @@ export const RepostButton = ({ <PostControlButtonIcon icon={Repost} /> {typeof repostCount !== 'undefined' && repostCount > 0 && ( <PostControlButtonText testID="repostCount"> - {formatCount(i18n, repostCount)} + {formatPostStatCount(repostCount)} </PostControlButtonText> )} </PostControlButton> |