From 27982504898cbc4c5b0fd654c31d837fd8044e91 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 19 Jan 2023 10:35:57 -0600 Subject: [PATCH] Post layout tweaks (#53) * Increase left margin on feed and embiggen avis * Decrease feed margins a bit * Tweak post bottom margin * Update loading placeholder to match feed * Update 'view full thread' positioning * Update postthread to match feed layout * Update notifications and individual post to match new layout * Add missing aborted check --- src/view/com/composer/ComposePost.tsx | 3 +++ src/view/com/notifications/FeedItem.tsx | 3 ++- src/view/com/post-thread/PostThreadItem.tsx | 27 +++++++++++++++------ src/view/com/post/Post.tsx | 4 ++- src/view/com/posts/FeedItem.tsx | 26 ++++++++++---------- src/view/com/util/LoadingPlaceholder.tsx | 5 ++-- src/view/lib/themes.ts | 2 +- 7 files changed, 44 insertions(+), 26 deletions(-) diff --git a/src/view/com/composer/ComposePost.tsx b/src/view/com/composer/ComposePost.tsx index 6a959d41..228b1103 100644 --- a/src/view/com/composer/ComposePost.tsx +++ b/src/view/com/composer/ComposePost.tsx @@ -117,6 +117,9 @@ export const ComposePost = observer(function ComposePost({ }) .catch(() => undefined) .then(localThumb => { + if (aborted) { + return + } setExtLink({ ...extLink, isLoading: false, // done diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index 97fab37d..0c516a08 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -230,6 +230,7 @@ function AdditionalPostText({ const styles = StyleSheet.create({ outer: { padding: 10, + paddingRight: 15, borderTopWidth: 1, }, outerUnread: { @@ -239,7 +240,7 @@ const styles = StyleSheet.create({ flexDirection: 'row', }, layoutIcon: { - width: 60, + width: 70, alignItems: 'flex-end', paddingTop: 2, }, diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 46512e75..8df6260c 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -116,12 +116,17 @@ export const PostThreadItem = observer(function PostThreadItem({ return ( <> + style={[ + styles.outer, + styles.outerHighlighted, + {borderTopColor: pal.colors.border}, + pal.view, + ]}> - - - + + + @@ -251,6 +250,8 @@ const styles = StyleSheet.create({ outer: { borderTopWidth: 1, padding: 10, + paddingRight: 15, + paddingBottom: 8, }, outerNoTop: { borderTopWidth: 0, @@ -264,21 +265,21 @@ const styles = StyleSheet.create({ }, topReplyLine: { position: 'absolute', - left: 34, + left: 42, top: 0, height: 6, borderLeftWidth: 2, }, bottomReplyLine: { position: 'absolute', - left: 34, + left: 42, top: 72, bottom: 0, borderLeftWidth: 2, }, includeReason: { flexDirection: 'row', - paddingLeft: 40, + paddingLeft: 50, marginTop: 2, marginBottom: 2, }, @@ -290,8 +291,8 @@ const styles = StyleSheet.create({ marginTop: 1, }, layoutAvi: { - width: 60, - paddingTop: 0, + width: 70, + paddingLeft: 8, }, layoutContent: { flex: 1, @@ -309,7 +310,6 @@ const styles = StyleSheet.create({ alignItems: 'center', flexWrap: 'wrap', paddingBottom: 4, - paddingRight: 20, }, embed: { marginBottom: 6, @@ -320,11 +320,11 @@ const styles = StyleSheet.create({ viewFullThread: { paddingTop: 12, paddingBottom: 2, - paddingLeft: 70, + paddingLeft: 80, }, viewFullThreadDots: { position: 'absolute', - left: 33, + left: 41, top: 0, }, }) diff --git a/src/view/com/util/LoadingPlaceholder.tsx b/src/view/com/util/LoadingPlaceholder.tsx index 587e2928..b51191bd 100644 --- a/src/view/com/util/LoadingPlaceholder.tsx +++ b/src/view/com/util/LoadingPlaceholder.tsx @@ -48,7 +48,7 @@ export function PostLoadingPlaceholder({ const pal = usePalette('default') return ( - + @@ -143,8 +143,9 @@ const styles = StyleSheet.create({ margin: 1, }, avatar: { - borderRadius: 25, + borderRadius: 26, marginRight: 10, + marginLeft: 6, }, notification: { padding: 10, diff --git a/src/view/lib/themes.ts b/src/view/lib/themes.ts index 847276c6..922ade5b 100644 --- a/src/view/lib/themes.ts +++ b/src/view/lib/themes.ts @@ -227,7 +227,7 @@ export const defaultTheme: Theme = { fontWeight: '400', }, 'post-text-lg': { - fontSize: 24, + fontSize: 22, letterSpacing: 0.4, fontWeight: '400', },