From 48aaf9e4f335afce5cfedd63ded261a20264fc44 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Mon, 4 Oct 2021 20:12:07 -0400 Subject: [PATCH] Fix quote styles so they are uniform --- stylesheets/_modules.scss | 14 ++------------ ts/components/CompositionArea.tsx | 1 - ts/components/conversation/Message.tsx | 4 ---- ts/components/conversation/Quote.stories.tsx | 17 ----------------- ts/components/conversation/Quote.tsx | 10 +--------- 5 files changed, 3 insertions(+), 43 deletions(-) diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index b7ab112247c..ad1e9faba7b 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -1442,23 +1442,17 @@ $timer-icons: '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '05', margin: { left: -6px; right: -6px; - top: -4px; + top: 3px; bottom: 5px; } } -.module-quote-container--with-content-above { - margin-top: 3px; -} - .module-quote { @include button-reset; width: 100%; position: relative; border-radius: 4px; - border-top-left-radius: 10px; - border-top-right-radius: 10px; display: flex; flex-direction: row; @@ -1479,11 +1473,6 @@ $timer-icons: '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '05', cursor: auto; } -.module-quote--with-content-above { - border-top-left-radius: 4px; - border-top-right-radius: 4px; -} - .module-quote--with-reference-warning { border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; @@ -1492,6 +1481,7 @@ $timer-icons: '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '05', .module-quote--outgoing { border-left-color: $color-steel; background-color: $color-steel; + margin-top: -4px; // To preserve contrast @include keyboard-mode { diff --git a/ts/components/CompositionArea.tsx b/ts/components/CompositionArea.tsx index 6e25407034f..a1808d9723b 100644 --- a/ts/components/CompositionArea.tsx +++ b/ts/components/CompositionArea.tsx @@ -578,7 +578,6 @@ export const CompositionArea = ({ // and this is for conversation_view. clearQuotedMessage(); }} - withContentAbove /> )} diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index bb5cc201885..56c4d75939c 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -1061,7 +1061,6 @@ export class Message extends React.PureComponent { public renderQuote(): JSX.Element | null { const { conversationColor, - conversationType, customColor, direction, disableScroll, @@ -1076,8 +1075,6 @@ export class Message extends React.PureComponent { return null; } - const withContentAbove = - conversationType === 'group' && direction === 'incoming'; const { isViewOnce, referencedMessageNotFound } = quote; const clickHandler = disableScroll @@ -1103,7 +1100,6 @@ export class Message extends React.PureComponent { isViewOnce={isViewOnce} referencedMessageNotFound={referencedMessageNotFound} isFromMe={quote.isFromMe} - withContentAbove={withContentAbove} doubleCheckMissingQuoteReference={() => doubleCheckMissingQuoteReference(id) } diff --git a/ts/components/conversation/Quote.stories.tsx b/ts/components/conversation/Quote.stories.tsx index c57ddc84f6d..01e155c4827 100644 --- a/ts/components/conversation/Quote.stories.tsx +++ b/ts/components/conversation/Quote.stories.tsx @@ -145,10 +145,6 @@ const createProps = (overrideProps: Partial = {}): Props => ({ ? overrideProps.text : 'A sample message from a pal' ), - withContentAbove: boolean( - 'withContentAbove', - overrideProps.withContentAbove || false - ), }); story.add('Outgoing by Another Author', () => { @@ -196,19 +192,6 @@ story.add('Incoming/Outgoing Colors', () => { ); }); -story.add('Content Above', () => { - const props = createProps({ - withContentAbove: true, - }); - - return ( - <> -
Content Above
- - - ); -}); - story.add('Image Only', () => { const props = createProps({ text: '', diff --git a/ts/components/conversation/Quote.tsx b/ts/components/conversation/Quote.tsx index 49fa8651b9d..6d551aa7a53 100644 --- a/ts/components/conversation/Quote.tsx +++ b/ts/components/conversation/Quote.tsx @@ -23,7 +23,6 @@ export type Props = { i18n: LocalizerType; isFromMe: boolean; isIncoming?: boolean; - withContentAbove: boolean; onClick?: () => void; onClose?: () => void; text: string; @@ -440,7 +439,6 @@ export class Quote extends React.Component { isIncoming, onClick, referencedMessageNotFound, - withContentAbove, } = this.props; if (!validateQuote(this.props)) { @@ -448,12 +446,7 @@ export class Quote extends React.Component { } return ( -
+