From f2d8d48e41bcb9bba0cb6bff8d069eb2c2e557e4 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 1 Dec 2022 18:57:59 +0800 Subject: [PATCH] Tweak the highlights view padding, handle empty string annotations --- .../web/components/patterns/HighlightView.tsx | 2 +- .../templates/article/HighlightsModal.tsx | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/web/components/patterns/HighlightView.tsx b/packages/web/components/patterns/HighlightView.tsx index 624bd53f4..459da76a3 100644 --- a/packages/web/components/patterns/HighlightView.tsx +++ b/packages/web/components/patterns/HighlightView.tsx @@ -22,7 +22,7 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { fontSize: '18px', lineHeight: '27px', color: '$grayText', - padding: '0px 10px', + padding: '0px 16px', borderLeft: '2px solid $omnivoreCtaYellow', }) diff --git a/packages/web/components/templates/article/HighlightsModal.tsx b/packages/web/components/templates/article/HighlightsModal.tsx index ee15b3274..8336472c4 100644 --- a/packages/web/components/templates/article/HighlightsModal.tsx +++ b/packages/web/components/templates/article/HighlightsModal.tsx @@ -13,8 +13,6 @@ import { } from '../../elements/LayoutPrimitives' import { Button } from '../../elements/Button' import { StyledText } from '../../elements/StyledText' -import { CrossIcon } from '../../elements/images/CrossIcon' -import { CommentIcon } from '../../elements/images/CommentIcon' import { TrashIcon } from '../../elements/images/TrashIcon' import { theme } from '../../tokens/stitches.config' import type { Highlight } from '../../../lib/networking/fragments/highlightFragment' @@ -22,7 +20,7 @@ import { HighlightView } from '../../patterns/HighlightView' import { useCallback, useRef, useState } from 'react' import { StyledTextArea } from '../../elements/StyledTextArea' import { ConfirmationModal } from '../../patterns/ConfirmationModal' -import { DotsThree, Pen, Trash } from 'phosphor-react' +import { DotsThree } from 'phosphor-react' import { Dropdown, DropdownOption } from '../../elements/DropdownElements' type HighlightsModalProps = { @@ -48,7 +46,7 @@ export function HighlightsModal(props: HighlightsModalProps): JSX.Element { > - + {props.highlights.map((highlight) => ( { - copyHighlight() + onSelect={async () => { + await copyHighlight() }} title="Copy" /> @@ -148,12 +146,14 @@ function ModalHighlightView(props: ModalHighlightViewProps): JSX.Element { bg: '$grayBase', p: '16px', width: '100%', - marginTop: '16px', + marginTop: '24px', color: '$grayText', }} onClick={() => setIsEditing(true)} > - {props.highlight.annotation ?? 'Add your notes...'} + {props.highlight.annotation + ? props.highlight.annotation + : 'Add your notes...'} ) : null} {isEditing && (