diff options
Diffstat (limited to 'src/components/PostControls/index.tsx')
-rw-r--r-- | src/components/PostControls/index.tsx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/components/PostControls/index.tsx b/src/components/PostControls/index.tsx index 834ad8e7d..f91bcd8a5 100644 --- a/src/components/PostControls/index.tsx +++ b/src/components/PostControls/index.tsx @@ -27,7 +27,7 @@ import { import * as Toast from '#/view/com/util/Toast' import {atoms as a, flatten, useBreakpoints} from '#/alf' import {Reply as Bubble} from '#/components/icons/Reply' -import {formatPostStatCount} from '#/components/PostControls/util' +import {useFormatPostStatCount} from '#/components/PostControls/util' import {BookmarkButton} from './BookmarkButton' import { PostControlButton, @@ -69,7 +69,7 @@ let PostControls = ({ viaRepost?: {uri: string; cid: string} variant?: 'compact' | 'normal' | 'large' }): React.ReactNode => { - const {_, i18n} = useLingui() + const {_} = useLingui() const {openComposer} = useOpenComposer() const {feedDescriptor} = useFeedFeedbackContext() const [queueLike, queueUnlike] = usePostLikeMutationQueue( @@ -95,6 +95,7 @@ let PostControls = ({ ) const replyDisabled = post.viewer?.replyDisabled const {gtPhone} = useBreakpoints() + const formatPostStatCount = useFormatPostStatCount() const [hasLikeIconBeenToggled, setHasLikeIconBeenToggled] = useState(false) @@ -232,9 +233,7 @@ let PostControls = ({ <PostControlButtonIcon icon={Bubble} /> {typeof post.replyCount !== 'undefined' && post.replyCount > 0 && ( <PostControlButtonText> - {formatPostStatCount(i18n, post.replyCount, { - compact: variant === 'compact', - })} + {formatPostStatCount(post.replyCount)} </PostControlButtonText> )} </PostControlButton> @@ -247,7 +246,6 @@ let PostControls = ({ onQuote={onQuote} big={big} embeddingDisabled={Boolean(post.viewer?.embeddingDisabled)} - compactCount={variant === 'compact'} /> </View> <View style={[a.flex_1, a.align_start]}> @@ -288,7 +286,6 @@ let PostControls = ({ big={big} isLiked={Boolean(post.viewer?.like)} hasBeenToggled={hasLikeIconBeenToggled} - compactCount={variant === 'compact'} /> </PostControlButton> </View> |