diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-07-06 21:12:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-06 21:12:54 -0500 |
commit | 6f69157269b27c4bae9730334f93f295ef0d4b94 (patch) | |
tree | f4a6a96cbfd959399a9b71cd116e9cbcfb26393e /src/view/com/posts/FeedItem.tsx | |
parent | df7552135a50d715a50ab592874eb84fc7c8bbcf (diff) | |
download | voidsky-6f69157269b27c4bae9730334f93f295ef0d4b94.tar.zst |
Post UI updates (Profile Preview on mobile) (#990)
* Update postmeta to put the timestamp on the right side on mobile * Drop the two-line PostMeta mode * Add ProfilePreview modal * Tune PostMeta to give the best behavior possible for a given platform * Remove old showFollowBtn attributes * Fix style issue * Switch the follow button in the profile header to use the inverted color for consistency with the rest of the app * Fix lint * Fix darkmode * Tune the profile preview footer * Better analytics choice
Diffstat (limited to 'src/view/com/posts/FeedItem.tsx')
-rw-r--r-- | src/view/com/posts/FeedItem.tsx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index 6ec2c80f4..e1b160dcb 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -21,7 +21,7 @@ import {ImageHider} from '../util/moderation/ImageHider' import {RichText} from '../util/text/RichText' import {PostSandboxWarning} from '../util/PostSandboxWarning' import * as Toast from '../util/Toast' -import {UserAvatar} from '../util/UserAvatar' +import {PreviewableUserAvatar} from '../util/UserAvatar' import {s} from 'lib/styles' import {useStores} from 'state/index' import {usePalette} from 'lib/hooks/usePalette' @@ -33,14 +33,12 @@ export const FeedItem = observer(function ({ item, isThreadChild, isThreadParent, - showFollowBtn, ignoreMuteFor, }: { item: PostsFeedItemModel isThreadChild?: boolean isThreadParent?: boolean showReplyLine?: boolean - showFollowBtn?: boolean ignoreMuteFor?: string }) { const store = useStores() @@ -55,7 +53,6 @@ export const FeedItem = observer(function ({ return `/profile/${item.post.author.handle}/post/${urip.rkey}` }, [item.post.uri, item.post.author.handle]) const itemTitle = `Post by ${item.post.author.handle}` - const authorHref = `/profile/${item.post.author.handle}` const replyAuthorDid = useMemo(() => { if (!record?.reply) { return '' @@ -214,13 +211,13 @@ export const FeedItem = observer(function ({ <PostSandboxWarning /> <View style={styles.layout}> <View style={styles.layoutAvi}> - <Link href={authorHref} title={item.post.author.handle} asAnchor> - <UserAvatar - size={52} - avatar={item.post.author.avatar} - moderation={item.moderation.avatar} - /> - </Link> + <PreviewableUserAvatar + size={52} + did={item.post.author.did} + handle={item.post.author.handle} + avatar={item.post.author.avatar} + moderation={item.moderation.avatar} + /> </View> <View style={styles.layoutContent}> <PostMeta @@ -229,8 +226,6 @@ export const FeedItem = observer(function ({ authorHasWarning={!!item.post.author.labels?.length} timestamp={item.post.indexedAt} postHref={itemHref} - did={item.post.author.did} - showFollowBtn={showFollowBtn} /> {!isThreadChild && replyAuthorDid !== '' && ( <View style={[s.flexRow, s.mb2, s.alignCenter]}> @@ -357,9 +352,9 @@ const styles = StyleSheet.create({ layout: { flexDirection: 'row', marginTop: 1, + gap: 10, }, layoutAvi: { - width: 70, paddingLeft: 8, }, layoutContent: { |