diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-09-21 13:47:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-21 13:47:42 -0700 |
commit | 7931787dd75727698ee9774dcb6c3de9fa467b54 (patch) | |
tree | 7aebb3a4dfc46641cdfc2a934955d1d51ae21665 /src | |
parent | 8a5f9cd43df6afde99c0e0111c7de0faa7635162 (diff) | |
download | voidsky-7931787dd75727698ee9774dcb6c3de9fa467b54.tar.zst |
Tune the treeview mode to use larger immediate-children (#1506)
* Tune the treeview mode to use larger immediate-children * Fix display name alignment
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/composer/Prompt.tsx | 2 | ||||
-rw-r--r-- | src/view/com/post-thread/PostThreadItem.tsx | 32 |
2 files changed, 14 insertions, 20 deletions
diff --git a/src/view/com/composer/Prompt.tsx b/src/view/com/composer/Prompt.tsx index 01fd7d1fa..b454a55f3 100644 --- a/src/view/com/composer/Prompt.tsx +++ b/src/view/com/composer/Prompt.tsx @@ -33,7 +33,7 @@ export function ComposePrompt({onPressCompose}: {onPressCompose: () => void}) { const styles = StyleSheet.create({ prompt: { - paddingHorizontal: 20, + paddingHorizontal: 18, paddingTop: 10, paddingBottom: 10, flexDirection: 'row', diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index b98ec805e..5f1723745 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -170,13 +170,13 @@ export const PostThreadItem = observer(function PostThreadItem({ <> {item.rootUri !== item.uri && ( <View style={{paddingLeft: 16, flexDirection: 'row', height: 16}}> - <View style={{width: 52}}> + <View style={{width: 38}}> <View style={[ styles.replyLine, { flexGrow: 1, - backgroundColor: pal.colors.replyLine, + backgroundColor: pal.colors.border, }, ]} /> @@ -395,7 +395,7 @@ export const PostThreadItem = observer(function PostThreadItem({ </> ) } else { - const isThreadedChild = treeView && item._depth > 0 + const isThreadedChild = treeView && item._depth > 1 return ( <PostOuterWrapper item={item} @@ -415,14 +415,14 @@ export const PostThreadItem = observer(function PostThreadItem({ paddingLeft: 8, height: isThreadedChild ? 8 : 16, }}> - <View style={{width: 52}}> + <View style={{width: 38}}> {!isThreadedChild && item._showParentReplyLine && ( <View style={[ styles.replyLine, { flexGrow: 1, - backgroundColor: pal.colors.replyLine, + backgroundColor: pal.colors.border, marginBottom: 4, }, ]} @@ -442,7 +442,7 @@ export const PostThreadItem = observer(function PostThreadItem({ {!isThreadedChild && ( <View style={styles.layoutAvi}> <PreviewableUserAvatar - size={isThreadedChild ? 36 : 52} + size={38} did={item.post.author.did} handle={item.post.author.handle} avatar={item.post.author.avatar} @@ -455,9 +455,7 @@ export const PostThreadItem = observer(function PostThreadItem({ styles.replyLine, { flexGrow: 1, - backgroundColor: isThreadedChild - ? pal.colors.border - : pal.colors.replyLine, + backgroundColor: pal.colors.border, marginTop: 4, }, ]} @@ -475,7 +473,7 @@ export const PostThreadItem = observer(function PostThreadItem({ showAvatar={isThreadedChild} avatarSize={26} displayNameType="md-bold" - displayNameStyle={s.ml2} + displayNameStyle={isThreadedChild && s.ml2} style={isThreadedChild && s.mb5} /> <PostAlerts @@ -483,11 +481,7 @@ export const PostThreadItem = observer(function PostThreadItem({ style={styles.alert} /> {item.richText?.text ? ( - <View - style={[ - styles.postTextContainer, - // isThreadedChild && {paddingTop: 2}, - ]}> + <View style={styles.postTextContainer}> <RichText type="post-text" richText={item.richText} @@ -572,7 +566,7 @@ function PostOuterWrapper({ }>) { const {isMobile} = useWebMediaQueries() const pal = usePalette('default') - if (treeView && item._depth > 0) { + if (treeView && item._depth > 1) { return ( <View style={[ @@ -581,7 +575,7 @@ function PostOuterWrapper({ styles.cursor, { flexDirection: 'row', - paddingLeft: 10, + paddingLeft: 20, borderTopWidth: item._depth === 1 ? 1 : 0, paddingTop: item._depth === 1 ? 8 : 0, }, @@ -592,8 +586,8 @@ function PostOuterWrapper({ style={{ borderLeftWidth: 2, borderLeftColor: pal.colors.border, - marginLeft: isMobile ? 6 : 14, - paddingLeft: isMobile ? 6 : 12, + marginLeft: n === 0 ? 14 : isMobile ? 6 : 14, + paddingLeft: n === 0 ? 18 : isMobile ? 6 : 12, }} /> ))} |