Truncate post metrics and fix truncation on native (#4575)

* truncate post counts

* add numberformat polyfill

* Fix perf

* Simplify type shenanigans

* Bump versions to remove dupes

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
Samuel Newman 2024-06-19 22:21:02 +01:00 committed by GitHub
parent ca17cf276f
commit 22c5aa4da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 68 additions and 49 deletions

View file

@ -39,6 +39,7 @@ import {
} from '#/components/icons/Heart2'
import * as Prompt from '#/components/Prompt'
import {PostDropdownBtn} from '../forms/PostDropdownBtn'
import {formatCount} from '../numeric/format'
import {Text} from '../text/Text'
import {RepostButton} from './RepostButton'
@ -226,7 +227,7 @@ let PostCtrls = ({
big ? a.text_md : {fontSize: 15},
a.user_select_none,
]}>
{post.replyCount}
{formatCount(post.replyCount)}
</Text>
) : undefined}
</Pressable>
@ -278,7 +279,7 @@ let PostCtrls = ({
: defaultCtrlColor,
],
]}>
{post.likeCount}
{formatCount(post.likeCount)}
</Text>
) : undefined}
</Pressable>