From d6a3eaea92bb00d06c9629319c08ca1d77a16ce0 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 31 Mar 2023 14:48:31 +0800 Subject: [PATCH] Fix notebook layout to match design, remove unused file --- .../elements/HighlightNoteTextEditArea.tsx | 91 ------------------- .../components/patterns/HighlightNotes.tsx | 10 +- .../web/components/patterns/HighlightView.tsx | 6 +- .../templates/article/NotebookModal.tsx | 4 +- 4 files changed, 12 insertions(+), 99 deletions(-) delete mode 100644 packages/web/components/elements/HighlightNoteTextEditArea.tsx diff --git a/packages/web/components/elements/HighlightNoteTextEditArea.tsx b/packages/web/components/elements/HighlightNoteTextEditArea.tsx deleted file mode 100644 index 4fad25dc7..000000000 --- a/packages/web/components/elements/HighlightNoteTextEditArea.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { useCallback, useState } from 'react' -import { Highlight } from '../../lib/networking/fragments/highlightFragment' -import { updateHighlightMutation } from '../../lib/networking/mutations/updateHighlightMutation' -import { showErrorToast, showSuccessToast } from '../../lib/toastHelpers' -import { Button } from './Button' -import { HStack, VStack } from './LayoutPrimitives' -import { StyledTextArea } from './StyledTextArea' - -type HighlightNoteTextEditAreaProps = { - setIsEditing: (editing: boolean) => void - highlight: Highlight - updateHighlight: (highlight: Highlight) => void -} - -export const HighlightNoteTextEditArea = ( - props: HighlightNoteTextEditAreaProps -): JSX.Element => { - const [noteContent, setNoteContent] = useState( - props.highlight.annotation ?? '' - ) - - const handleNoteContentChange = useCallback( - (event: React.ChangeEvent): void => { - setNoteContent(event.target.value) - }, - [setNoteContent] - ) - - return ( - - - - - - - - ) -} diff --git a/packages/web/components/patterns/HighlightNotes.tsx b/packages/web/components/patterns/HighlightNotes.tsx index be51b17b8..7e223d26d 100644 --- a/packages/web/components/patterns/HighlightNotes.tsx +++ b/packages/web/components/patterns/HighlightNotes.tsx @@ -286,12 +286,14 @@ export function MarkdownNote(props: MarkdownNote): JSX.Element { <> *': { m: '0px', }, diff --git a/packages/web/components/patterns/HighlightView.tsx b/packages/web/components/patterns/HighlightView.tsx index efe45e0a9..c421bbb24 100644 --- a/packages/web/components/patterns/HighlightView.tsx +++ b/packages/web/components/patterns/HighlightView.tsx @@ -41,7 +41,7 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { @@ -78,6 +78,8 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { '> *': { m: '0px', }, + fontSize: '15px', + lineHeight: 1.5, color: '$grayText', img: { display: 'block', diff --git a/packages/web/components/templates/article/NotebookModal.tsx b/packages/web/components/templates/article/NotebookModal.tsx index 9a07f26dd..1bc5ce552 100644 --- a/packages/web/components/templates/article/NotebookModal.tsx +++ b/packages/web/components/templates/article/NotebookModal.tsx @@ -3,7 +3,7 @@ import { ModalOverlay, ModalContent, } from '../../elements/ModalPrimitives' -import { Box, HStack } from '../../elements/LayoutPrimitives' +import { HStack } from '../../elements/LayoutPrimitives' import { Button } from '../../elements/Button' import { StyledText } from '../../elements/StyledText' import { theme } from '../../tokens/stitches.config' @@ -114,7 +114,7 @@ export function NotebookModal(props: NotebookModalProps): JSX.Element { css={{ ml: 'auto', cursor: 'pointer', - gap: '5px', + gap: '15px', mr: '-5px', }} distribution="center"