From 187d06fd69c0e93b6c14fd7c874ce296848f8d03 Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:13:22 -0500 Subject: [PATCH] Fix color of quotes in chats with custom colors --- stylesheets/components/Quote.scss | 7 +++++++ ts/components/conversation/Quote.tsx | 21 ++++++++++++++++----- ts/services/backups/export.ts | 9 +++++++-- ts/util/getCustomColorStyle.ts | 6 +++--- ts/util/getHSL.ts | 4 ++-- 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/stylesheets/components/Quote.scss b/stylesheets/components/Quote.scss index ab6aeec28..6f64de49c 100644 --- a/stylesheets/components/Quote.scss +++ b/stylesheets/components/Quote.scss @@ -162,6 +162,13 @@ } } +.module-quote--outgoing-custom { + .module-quote__primary, + &.module-quote__reference-warning { + border-inline-start-color: variables.$color-white; + } +} + .module-quote__primary { flex-grow: 1; padding-inline: 8px; diff --git a/ts/components/conversation/Quote.tsx b/ts/components/conversation/Quote.tsx index 8be91ecec..779dc8ccb 100644 --- a/ts/components/conversation/Quote.tsx +++ b/ts/components/conversation/Quote.tsx @@ -477,6 +477,14 @@ export function Quote(props: Props): JSX.Element | null { ); } + const customColorStyle = getCustomColorStyle(customColor, true); + + // We don't set a custom color for outgoing quotes + const borderInlineStartColor = + isIncoming || isCompose + ? customColorStyle?.borderInlineStartColor + : undefined; + function renderReferenceWarning() { if (!referencedMessageNotFound || isStoryReply) { return null; @@ -490,9 +498,7 @@ export function Quote(props: Props): JSX.Element | null { ? getClassName(`--incoming-${conversationColor}`) : getClassName(`--outgoing-${conversationColor}`) )} - style={{ - ...getCustomColorStyle(customColor, true), - }} + style={{ ...customColorStyle, borderInlineStartColor }} >