From 08f0a5cc7172a4308c720f40b2df70e5495edb92 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 13 Jun 2025 16:20:12 -0500 Subject: [PATCH] Move to new Post components dir --- .../{ShowMore.tsx => Post/ShowMoreTextButton.tsx} | 7 ++++--- src/screens/PostThread/components/ThreadItemPost.tsx | 7 +++++-- src/screens/PostThread/components/ThreadItemTreePost.tsx | 4 ++-- src/view/com/post-thread/PostThreadItem.tsx | 7 +++++-- src/view/com/post/Post.tsx | 7 +++++-- src/view/com/posts/PostFeedItem.tsx | 4 ++-- 6 files changed, 23 insertions(+), 13 deletions(-) rename src/components/{ShowMore.tsx => Post/ShowMoreTextButton.tsx} (85%) diff --git a/src/components/ShowMore.tsx b/src/components/Post/ShowMoreTextButton.tsx similarity index 85% rename from src/components/ShowMore.tsx rename to src/components/Post/ShowMoreTextButton.tsx index bc903c5cc4..bc6db55b9e 100644 --- a/src/components/ShowMore.tsx +++ b/src/components/Post/ShowMoreTextButton.tsx @@ -4,11 +4,11 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {HITSLOP_10} from '#/lib/constants' -import {atoms as a, flatten, type TextStyleProp,useTheme} from '#/alf' +import {atoms as a, flatten, type TextStyleProp, useTheme} from '#/alf' import {Button} from '#/components/Button' import {Text} from '#/components/Typography' -export function ShowMore({ +export function ShowMoreTextButton({ onPress: onPressProp, style, }: TextStyleProp & {onPress: () => void}) { @@ -44,7 +44,8 @@ export function ShowMore({ textStyle, { color: t.palette.primary_500, - opacity: pressed || hovered ? 0.6 : 1, + opacity: pressed ? 0.6 : 1, + textDecorationLine: hovered ? 'underline' : undefined, }, ]}> Show More diff --git a/src/screens/PostThread/components/ThreadItemPost.tsx b/src/screens/PostThread/components/ThreadItemPost.tsx index e9b02b8248..4337397f84 100644 --- a/src/screens/PostThread/components/ThreadItemPost.tsx +++ b/src/screens/PostThread/components/ThreadItemPost.tsx @@ -37,9 +37,9 @@ 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 {ShowMore} from '#/components/ShowMore' import * as Skele from '#/components/Skeleton' import {SubtleWebHover} from '#/components/SubtleWebHover' import {Text} from '#/components/Typography' @@ -310,7 +310,10 @@ const ThreadItemPostInner = memo(function ThreadItemPostInner({ shouldProxyLinks={true} /> {limitLines && ( - + )} ) : undefined} diff --git a/src/screens/PostThread/components/ThreadItemTreePost.tsx b/src/screens/PostThread/components/ThreadItemTreePost.tsx index 890dfa1100..a8ffb76f46 100644 --- a/src/screens/PostThread/components/ThreadItemTreePost.tsx +++ b/src/screens/PostThread/components/ThreadItemTreePost.tsx @@ -36,9 +36,9 @@ 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 {ShowMore} from '#/components/ShowMore' import * as Skele from '#/components/Skeleton' import {SubtleWebHover} from '#/components/SubtleWebHover' import {Text} from '#/components/Typography' @@ -354,7 +354,7 @@ const ThreadItemTreePostInner = memo(function ThreadItemTreePostInner({ shouldProxyLinks={true} /> {limitLines && ( - diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index a42874f61f..592224ff54 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -62,10 +62,10 @@ 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 * as Prompt from '#/components/Prompt' import {RichText} from '#/components/RichText' -import {ShowMore} from '#/components/ShowMore' import {SubtleWebHover} from '#/components/SubtleWebHover' import {Text} from '#/components/Typography' import {VerificationCheckButton} from '#/components/verification/VerificationCheckButton' @@ -687,7 +687,10 @@ let PostThreadItemLoaded = ({ shouldProxyLinks={true} /> {limitLines && ( - + )} ) : undefined} diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index e7644f05ee..5960810ff0 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -36,10 +36,10 @@ import {ContentHider} from '#/components/moderation/ContentHider' import {LabelsOnMyPost} from '#/components/moderation/LabelsOnMe' import {PostAlerts} from '#/components/moderation/PostAlerts' import {Embed, PostEmbedViewContext} from '#/components/Post/Embed' +import {ShowMoreTextButton} from '#/components/Post/ShowMoreTextButton' import {PostControls} from '#/components/PostControls' import {ProfileHoverCard} from '#/components/ProfileHoverCard' import {RichText} from '#/components/RichText' -import {ShowMore} from '#/components/ShowMore' import {SubtleWebHover} from '#/components/SubtleWebHover' import * as bsky from '#/types/bsky' @@ -237,7 +237,10 @@ function PostInner({ shouldProxyLinks={true} /> {limitLines && ( - + )} ) : undefined} diff --git a/src/view/com/posts/PostFeedItem.tsx b/src/view/com/posts/PostFeedItem.tsx index 2b8f396471..affec0900b 100644 --- a/src/view/com/posts/PostFeedItem.tsx +++ b/src/view/com/posts/PostFeedItem.tsx @@ -54,11 +54,11 @@ 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' import {RichText} from '#/components/RichText' -import {ShowMore} from '#/components/ShowMore' import {SubtleWebHover} from '#/components/SubtleWebHover' import * as bsky from '#/types/bsky' @@ -557,7 +557,7 @@ let PostContent = ({ shouldProxyLinks={true} /> {limitLines && ( - + )} ) : undefined}