From a72f55a11fcc45440314d30656c9d563181a0001 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 30 May 2024 14:34:30 +0300 Subject: [PATCH] Composer - fix divider when replying to someone (#4279) * move replyto border to beneath * use hairline width for consistency * fix border colors --- src/view/com/composer/Composer.tsx | 4 +++- src/view/com/composer/ComposerReplyTo.tsx | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 00dbcb59..4911adf2 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -183,7 +183,9 @@ export const ComposePost = observer(function ComposePost({ [0, 1], [ 'transparent', - isWeb ? t.palette.contrast_100 : t.palette.contrast_400, + isWeb + ? t.atoms.border_contrast_low.borderColor + : t.atoms.border_contrast_high.borderColor, ], ), } diff --git a/src/view/com/composer/ComposerReplyTo.tsx b/src/view/com/composer/ComposerReplyTo.tsx index 7dc17fd4..1bb4a5c2 100644 --- a/src/view/com/composer/ComposerReplyTo.tsx +++ b/src/view/com/composer/ComposerReplyTo.tsx @@ -10,16 +10,17 @@ import { import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {usePalette} from 'lib/hooks/usePalette' +import {isWeb} from '#/platform/detection' import {sanitizeDisplayName} from 'lib/strings/display-names' import {sanitizeHandle} from 'lib/strings/handles' import {ComposerOptsPostRef} from 'state/shell/composer' import {QuoteEmbed} from 'view/com/util/post-embeds/QuoteEmbed' import {Text} from 'view/com/util/text/Text' import {PreviewableUserAvatar} from 'view/com/util/UserAvatar' +import {useTheme} from '#/alf' export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) { - const pal = usePalette('default') + const t = useTheme() const {_} = useLingui() const {embed} = replyTo @@ -75,7 +76,10 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) { return ( - + {sanitizeDisplayName( replyTo.author.displayName || sanitizeHandle(replyTo.author.handle), )} @@ -100,7 +104,7 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) { {replyTo.text} @@ -218,7 +222,7 @@ const styles = StyleSheet.create({ replyToLayout: { flexDirection: 'row', alignItems: 'flex-start', - borderTopWidth: 1, + borderBottomWidth: StyleSheet.hairlineWidth, paddingTop: 16, paddingBottom: 16, },