diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-06-14 00:43:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-13 16:43:17 -0500 |
commit | 00469314ca2f76bf13d0526afdd6c9253c0953d1 (patch) | |
tree | b21d41d3eac86d3c135c9d701f65a1be47d09ee4 /src/screens/PostThread/components/ThreadItemPost.tsx | |
parent | ed9691511beb26bdb799bbcb9a973a8b8df3433c (diff) | |
download | voidsky-00469314ca2f76bf13d0526afdd6c9253c0953d1.tar.zst |
Use Button instead of TextLink for show more button (#8480)
* use button instead of TextLink for show more * Match post text size, provide interaction feedback * Move to new Post components dir * Prettier --------- Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/screens/PostThread/components/ThreadItemPost.tsx')
-rw-r--r-- | src/screens/PostThread/components/ThreadItemPost.tsx | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/screens/PostThread/components/ThreadItemPost.tsx b/src/screens/PostThread/components/ThreadItemPost.tsx index 9393a6d1b..4337397f8 100644 --- a/src/screens/PostThread/components/ThreadItemPost.tsx +++ b/src/screens/PostThread/components/ThreadItemPost.tsx @@ -6,13 +6,11 @@ import { AtUri, RichText as RichTextAPI, } from '@atproto/api' -import {msg, Trans} from '@lingui/macro' -import {useLingui} from '@lingui/react' +import {Trans} from '@lingui/macro' import {useActorStatus} from '#/lib/actor-status' import {MAX_POST_LINES} from '#/lib/constants' import {useOpenComposer} from '#/lib/hooks/useOpenComposer' -import {usePalette} from '#/lib/hooks/usePalette' import {makeProfileLink} from '#/lib/routes/links' import {countLines} from '#/lib/strings/helpers' import { @@ -24,7 +22,6 @@ import {type ThreadItem} from '#/state/queries/usePostThread/types' import {useSession} from '#/state/session' import {type OnPostSuccessData} from '#/state/shell/composer' import {useMergedThreadgateHiddenReplies} from '#/state/threadgate-hidden-replies' -import {TextLink} from '#/view/com/util/Link' import {PostMeta} from '#/view/com/util/PostMeta' import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' import { @@ -40,6 +37,7 @@ import {PostAlerts} from '#/components/moderation/PostAlerts' import {PostHider} from '#/components/moderation/PostHider' import {type AppModerationCause} from '#/components/Pills' import {Embed, PostEmbedViewContext} from '#/components/Post/Embed' +import {ShowMoreTextButton} from '#/components/Post/ShowMoreTextButton' import {PostControls} from '#/components/PostControls' import {RichText} from '#/components/RichText' import * as Skele from '#/components/Skeleton' @@ -187,8 +185,6 @@ const ThreadItemPostInner = memo(function ThreadItemPostInner({ postShadow: Shadow<AppBskyFeedDefs.PostView> }) { const t = useTheme() - const pal = usePalette('default') - const {_} = useLingui() const {openComposer} = useOpenComposer() const {currentAccount} = useSession() @@ -304,22 +300,22 @@ const ThreadItemPostInner = memo(function ThreadItemPostInner({ additionalCauses={additionalPostAlerts} /> {richText?.text ? ( - <RichText - enableTags - value={richText} - style={[a.flex_1, a.text_md]} - numberOfLines={limitLines ? MAX_POST_LINES : undefined} - authorHandle={post.author.handle} - shouldProxyLinks={true} - /> - ) : undefined} - {limitLines ? ( - <TextLink - text={_(msg`Show More`)} - style={pal.link} - onPress={onPressShowMore} - href="#" - /> + <> + <RichText + enableTags + value={richText} + style={[a.flex_1, a.text_md]} + numberOfLines={limitLines ? MAX_POST_LINES : undefined} + authorHandle={post.author.handle} + shouldProxyLinks={true} + /> + {limitLines && ( + <ShowMoreTextButton + style={[a.text_md]} + onPress={onPressShowMore} + /> + )} + </> ) : undefined} {post.embed && ( <View style={[a.pb_xs]}> |