From a4a32dec2b4dede450a6b206fa46e04077c98cde Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 1 Dec 2022 18:26:35 +0800 Subject: [PATCH] Make the web notebook UI better match the iOS UI --- .../web/components/elements/StyledText.tsx | 15 -- .../web/components/patterns/HighlightView.tsx | 28 ++- .../article/ArticleHeaderToolbar.tsx | 15 +- .../templates/article/HighlightsModal.tsx | 181 ++++++++++++------ 4 files changed, 140 insertions(+), 99 deletions(-) diff --git a/packages/web/components/elements/StyledText.tsx b/packages/web/components/elements/StyledText.tsx index f1c6b5c61..9b2bde36d 100644 --- a/packages/web/components/elements/StyledText.tsx +++ b/packages/web/components/elements/StyledText.tsx @@ -113,21 +113,6 @@ const textVariants = { textDecoration: 'underline', cursor: 'pointer', }, - highlightTitleAndAuthor: { - fontSize: '18px', - fontStyle: 'italic', - lineHeight: '22.5px', - letterSpacing: '0.01em', - margin: '0px', - color: '$utilityTextSubtle', - }, - highlightTitle: { - fontSize: '14px', - fontWeight: '400', - lineHeight: '1.5', - margin: '0px', - color: '$omnivoreGray', - }, navLink: { m: 0, fontSize: '$1', diff --git a/packages/web/components/patterns/HighlightView.tsx b/packages/web/components/patterns/HighlightView.tsx index 6e69f9842..624bd53f4 100644 --- a/packages/web/components/patterns/HighlightView.tsx +++ b/packages/web/components/patterns/HighlightView.tsx @@ -8,7 +8,7 @@ type HighlightViewProps = { highlight: Highlight author?: string title?: string - scrollToHighlight?: (arg: string) => void; + scrollToHighlight?: (arg: string) => void } export function HighlightView(props: HighlightViewProps): JSX.Element { @@ -21,19 +21,21 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { margin: '0px 0px 0px 0px', fontSize: '18px', lineHeight: '27px', - color: '$utilityTextDefault', - cursor: 'pointer', + color: '$grayText', + padding: '0px 10px', + borderLeft: '2px solid $omnivoreCtaYellow', }) return ( - { - if (props.scrollToHighlight) { - props.scrollToHighlight(props.highlight.id) - } - }}> - {props.highlight.prefix} - + { + if (props.scrollToHighlight) { + props.scrollToHighlight(props.highlight.id) + } + }} + > + {lines.map((line: string, index: number) => ( {line} @@ -46,13 +48,7 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { ))} - {props.highlight.suffix} - - {props.author && props.title &&( - {props.title + props.author} - )} - ) } diff --git a/packages/web/components/templates/article/ArticleHeaderToolbar.tsx b/packages/web/components/templates/article/ArticleHeaderToolbar.tsx index 10b0e993b..f7ca4cf51 100644 --- a/packages/web/components/templates/article/ArticleHeaderToolbar.tsx +++ b/packages/web/components/templates/article/ArticleHeaderToolbar.tsx @@ -46,12 +46,15 @@ export function ArticleHeaderToolbar( return ( {props.hasHighlights && ( - - )} - - ) - - const TextEditArea = (): JSX.Element => ( - + return ( + @@ -149,17 +219,4 @@ function ModalHighlightView(props: ModalHighlightViewProps): JSX.Element { ) - - return ( - <> - - - {props.highlight.annotation && !isEditing ? ( - {props.highlight.annotation} - ) : null} - {isEditing ? : } - - - - ) }