diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index a0ae768088..19bdfc1c1f 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -22,7 +22,7 @@ import {useStores} from 'state/index' import {PostMeta} from '../util/PostMeta' import {PostEmbeds} from '../util/post-embeds' import {PostCtrls} from '../util/PostCtrls' -import {PostHider} from '../util/PostHider' +import {PostContainer} from '../util/PostContainer' import {ErrorMessage} from '../util/error/ErrorMessage' import {usePalette} from 'lib/hooks/usePalette' @@ -270,15 +270,13 @@ export const PostThreadItem = observer(function PostThreadItem({ ) } else { return ( - - + + style={[styles.outer, {borderTopColor: pal.colors.border}, pal.view]} + isMuted={item.post.author.viewer?.muted === true} + labels={item.post.labels}> {item._showParentReplyLine && ( - + {item._hasMore ? ( ) : undefined} - + ) } }) diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index eb8d623960..01847b05b6 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -17,7 +17,7 @@ import {UserInfoText} from '../util/UserInfoText' import {PostMeta} from '../util/PostMeta' import {PostEmbeds} from '../util/post-embeds' import {PostCtrls} from '../util/PostCtrls' -import {PostHider} from '../util/PostHider' +import {PostContainer} from '../util/PostContainer' import {Text} from '../util/text/Text' import {RichText} from '../util/text/RichText' import * as Toast from '../util/Toast' @@ -150,86 +150,82 @@ export const Post = observer(function Post({ } return ( - - - {showReplyLine && } - - - - - - - - - {replyAuthorDid !== '' && ( - - - - Reply to - - - - )} - {item.richText?.text ? ( - - - - ) : undefined} - - - + {showReplyLine && } + + + + + - - + + + {replyAuthorDid !== '' && ( + + + + Reply to + + + + )} + {item.richText?.text ? ( + + + + ) : undefined} + + + + + ) }) diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index 2f093cdc3f..2d9289a395 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -14,7 +14,7 @@ import {UserInfoText} from '../util/UserInfoText' import {PostMeta} from '../util/PostMeta' import {PostCtrls} from '../util/PostCtrls' import {PostEmbeds} from '../util/post-embeds' -import {PostHider} from '../util/PostHider' +import {PostContainer} from '../util/PostContainer' import {RichText} from '../util/text/RichText' import * as Toast from '../util/Toast' import {UserAvatar} from '../util/UserAvatar' @@ -132,137 +132,134 @@ export const FeedItem = observer(function ({ ] return ( - - - {isThreadChild && ( - - )} - {isThreadParent && ( - + {isThreadChild && ( + + )} + {isThreadParent && ( + + )} + {item.reasonRepost && ( + + - )} - {item.reasonRepost && ( - - - + Reposted by{' '} + - Reposted by{' '} - - + numberOfLines={1} + text={sanitizeDisplayName( + item.reasonRepost.by.displayName || item.reasonRepost.by.handle, + )} + href={`/profile/${item.reasonRepost.by.handle}`} + /> + + + )} + + + + - )} - - - - - - - - - {!isThreadChild && replyAuthorDid !== '' && ( - - - - Reply to - - - - )} - {item.richText?.text ? ( - - - - ) : undefined} - - - - - + + + {!isThreadChild && replyAuthorDid !== '' && ( + + + + Reply to + + + + )} + {item.richText?.text ? ( + + + + ) : undefined} + + + + + ) }) diff --git a/src/view/com/util/PostHider.tsx b/src/view/com/util/PostContainer.tsx similarity index 67% rename from src/view/com/util/PostHider.tsx rename to src/view/com/util/PostContainer.tsx index 4df256de70..d1b7454217 100644 --- a/src/view/com/util/PostHider.tsx +++ b/src/view/com/util/PostContainer.tsx @@ -1,25 +1,43 @@ import React from 'react' -import {StyleSheet, TouchableOpacity, View} from 'react-native' +import { + StyleProp, + StyleSheet, + TouchableOpacity, + View, + ViewStyle, +} from 'react-native' import {ComAtprotoLabelDefs} from '@atproto/api' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {usePalette} from 'lib/hooks/usePalette' +import {Link} from './Link' import {Text} from './text/Text' import {getLabelValueGroup} from 'lib/labeling/helpers' +import {addStyle} from 'lib/styles' -export function PostHider({ +export function PostContainer({ + testID, + href, isMuted, labels, + style, children, }: React.PropsWithChildren<{ + testID?: string + href: string isMuted?: boolean + style: StyleProp labels: ComAtprotoLabelDefs.Label[] | undefined }>) { const pal = usePalette('default') - const palError = usePalette('error') const [override, setOverride] = React.useState(false) + const bg = override ? pal.viewLight : pal.view if (!isMuted && !labels?.length) { - return <>{children} + return ( + + {children} + + ) } const label = labels?.[0] // TODO use config to settle on most relevant item @@ -29,8 +47,8 @@ export function PostHider({ } return ( - - + <> + {override && ( - - {children} + + + {children} + )} - + ) } @@ -78,6 +101,10 @@ const styles = StyleSheet.create({ }, childrenContainer: { paddingHorizontal: 6, - paddingVertical: 6, + paddingBottom: 6, + }, + child: { + borderWidth: 1, + borderRadius: 12, }, })