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/view/com/posts/PostFeedItem.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/view/com/posts/PostFeedItem.tsx')
-rw-r--r-- | src/view/com/posts/PostFeedItem.tsx | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/view/com/posts/PostFeedItem.tsx b/src/view/com/posts/PostFeedItem.tsx index 6755f013d..96d5df5e9 100644 --- a/src/view/com/posts/PostFeedItem.tsx +++ b/src/view/com/posts/PostFeedItem.tsx @@ -41,7 +41,7 @@ import { setUnstablePostSource, } from '#/state/unstable-post-source' import {FeedNameText} from '#/view/com/util/FeedInfoText' -import {Link, TextLink, TextLinkOnWebOnly} from '#/view/com/util/Link' +import {Link, TextLinkOnWebOnly} from '#/view/com/util/Link' import {PostMeta} from '#/view/com/util/PostMeta' import {Text} from '#/view/com/util/text/Text' import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' @@ -54,6 +54,7 @@ import {PostAlerts} from '#/components/moderation/PostAlerts' import {type AppModerationCause} from '#/components/Pills' import {Embed} from '#/components/Post/Embed' import {PostEmbedViewContext} from '#/components/Post/Embed/types' +import {ShowMoreTextButton} from '#/components/Post/ShowMoreTextButton' import {PostControls} from '#/components/PostControls' import {DiscoverDebug} from '#/components/PostControls/DiscoverDebug' import {ProfileHoverCard} from '#/components/ProfileHoverCard' @@ -501,8 +502,6 @@ let PostContent = ({ post: AppBskyFeedDefs.PostView threadgateRecord?: AppBskyFeedThreadgate.Record }): React.ReactNode => { - const pal = usePalette('default') - const {_} = useLingui() const {currentAccount} = useSession() const [limitLines, setLimitLines] = useState( () => countLines(richText.text) >= MAX_POST_LINES, @@ -547,7 +546,7 @@ let PostContent = ({ additionalCauses={additionalPostAlerts} /> {richText.text ? ( - <View style={styles.postTextContainer}> + <> <RichText enableTags testID="postText" @@ -557,15 +556,10 @@ let PostContent = ({ authorHandle={postAuthor.handle} shouldProxyLinks={true} /> - </View> - ) : undefined} - {limitLines ? ( - <TextLink - text={_(msg`Show More`)} - style={pal.link} - onPress={onPressShowMore} - href="#" - /> + {limitLines && ( + <ShowMoreTextButton style={[a.text_md]} onPress={onPressShowMore} /> + )} + </> ) : undefined} {postEmbed ? ( <View style={[a.pb_xs]}> @@ -689,13 +683,6 @@ const styles = StyleSheet.create({ marginTop: 6, marginBottom: 6, }, - postTextContainer: { - flexDirection: 'row', - alignItems: 'center', - flexWrap: 'wrap', - paddingBottom: 2, - overflow: 'hidden', - }, contentHiderChild: { marginTop: 6, }, |