Remove some confusing horizontal lines in threads (#566)

zio/stable
Paul Frazee 2023-05-02 23:32:29 -05:00 committed by GitHub
parent 883700e090
commit 12a2144232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -125,7 +125,7 @@ export class PostThreadItemModel {
parentModel._depth = this._depth - 1 parentModel._depth = this._depth - 1
parentModel._showChildReplyLine = true parentModel._showChildReplyLine = true
if (v.parent.parent) { if (v.parent.parent) {
parentModel._showParentReplyLine = true //parentModel.uri !== higlightedPostUri parentModel._showParentReplyLine = true
parentModel.assignTreeModels(v.parent, higlightedPostUri, true, false) parentModel.assignTreeModels(v.parent, higlightedPostUri, true, false)
} }
this.parent = parentModel this.parent = parentModel
@ -143,7 +143,7 @@ export class PostThreadItemModel {
const itemModel = new PostThreadItemModel(this.rootStore, item) const itemModel = new PostThreadItemModel(this.rootStore, item)
itemModel._depth = this._depth + 1 itemModel._depth = this._depth + 1
itemModel._showParentReplyLine = itemModel._showParentReplyLine =
itemModel.parentUri !== higlightedPostUri itemModel.parentUri !== higlightedPostUri && replies.length === 0
if (item.replies?.length) { if (item.replies?.length) {
itemModel._showChildReplyLine = true itemModel._showChildReplyLine = true
itemModel.assignTreeModels(item, higlightedPostUri, false, true) itemModel.assignTreeModels(item, higlightedPostUri, false, true)

View File

@ -310,7 +310,12 @@ export const PostThreadItem = observer(function PostThreadItem({
<PostHider <PostHider
testID={`postThreadItem-by-${item.post.author.handle}`} testID={`postThreadItem-by-${item.post.author.handle}`}
href={itemHref} href={itemHref}
style={[styles.outer, {borderColor: pal.colors.border}, pal.view]} style={[
styles.outer,
pal.border,
pal.view,
item._showParentReplyLine && styles.noTopBorder,
]}
moderation={item.moderation.thread}> moderation={item.moderation.thread}>
{item._showParentReplyLine && ( {item._showParentReplyLine && (
<View <View
@ -425,6 +430,9 @@ const styles = StyleSheet.create({
paddingLeft: 6, paddingLeft: 6,
paddingRight: 6, paddingRight: 6,
}, },
noTopBorder: {
borderTopWidth: 0,
},
parentReplyLine: { parentReplyLine: {
position: 'absolute', position: 'absolute',
left: 44, left: 44,