hide top border for mentions and replies (#4330)

This commit is contained in:
Hailey 2024-06-03 09:21:02 -07:00 committed by GitHub
parent 708a80e7a7
commit d93acb25f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -148,6 +148,7 @@ let FeedItem = ({
borderColor: pal.colors.unreadNotifBorder, borderColor: pal.colors.unreadNotifBorder,
} }
} }
hideTopBorder={hideTopBorder}
/> />
</Link> </Link>
) )

View file

@ -41,10 +41,12 @@ import hairlineWidth = StyleSheet.hairlineWidth
export function Post({ export function Post({
post, post,
showReplyLine, showReplyLine,
hideTopBorder,
style, style,
}: { }: {
post: AppBskyFeedDefs.PostView post: AppBskyFeedDefs.PostView
showReplyLine?: boolean showReplyLine?: boolean
hideTopBorder?: boolean
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
}) { }) {
const moderationOpts = useModerationOpts() const moderationOpts = useModerationOpts()
@ -82,6 +84,7 @@ export function Post({
richText={richText} richText={richText}
moderation={moderation} moderation={moderation}
showReplyLine={showReplyLine} showReplyLine={showReplyLine}
hideTopBorder={hideTopBorder}
style={style} style={style}
/> />
) )
@ -95,6 +98,7 @@ function PostInner({
richText, richText,
moderation, moderation,
showReplyLine, showReplyLine,
hideTopBorder,
style, style,
}: { }: {
post: Shadow<AppBskyFeedDefs.PostView> post: Shadow<AppBskyFeedDefs.PostView>
@ -102,6 +106,7 @@ function PostInner({
richText: RichTextAPI richText: RichTextAPI
moderation: ModerationDecision moderation: ModerationDecision
showReplyLine?: boolean showReplyLine?: boolean
hideTopBorder?: boolean
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
}) { }) {
const queryClient = useQueryClient() const queryClient = useQueryClient()
@ -143,7 +148,12 @@ function PostInner({
return ( return (
<Link <Link
href={itemHref} href={itemHref}
style={[styles.outer, pal.border, style]} style={[
styles.outer,
pal.border,
!hideTopBorder && {borderTopWidth: hairlineWidth},
style,
]}
onBeforePress={onBeforePress}> onBeforePress={onBeforePress}>
{showReplyLine && <View style={styles.replyLine} />} {showReplyLine && <View style={styles.replyLine} />}
<View style={styles.layout}> <View style={styles.layout}>
@ -243,7 +253,6 @@ const styles = StyleSheet.create({
paddingRight: 15, paddingRight: 15,
paddingBottom: 5, paddingBottom: 5,
paddingLeft: 10, paddingLeft: 10,
borderTopWidth: hairlineWidth,
// @ts-ignore web only -prf // @ts-ignore web only -prf
cursor: 'pointer', cursor: 'pointer',
}, },