From 560853fb1d77f696beefb31254ef28f24fd2e2dc Mon Sep 17 00:00:00 2001 From: Rupin Khandelwal Date: Wed, 22 Jun 2022 11:49:35 -0700 Subject: [PATCH 1/2] Issue-835-Part-1 --- .../elements/images/PenWithColorIcon.tsx | 55 +++++++++++++++++ .../web/components/patterns/HighlightBar.tsx | 59 ++++++++++++++----- 2 files changed, 100 insertions(+), 14 deletions(-) create mode 100644 packages/web/components/elements/images/PenWithColorIcon.tsx diff --git a/packages/web/components/elements/images/PenWithColorIcon.tsx b/packages/web/components/elements/images/PenWithColorIcon.tsx new file mode 100644 index 000000000..b3c8a75d1 --- /dev/null +++ b/packages/web/components/elements/images/PenWithColorIcon.tsx @@ -0,0 +1,55 @@ +import { config } from '../../tokens/stitches.config' + +type PenWithColorProps = { + color?: string + width?: number + height?: number +} + +export function PenWithColorIcon({ + color, + height, + width, +}: PenWithColorProps): JSX.Element { + return ( + + + + + + + + ) +} diff --git a/packages/web/components/patterns/HighlightBar.tsx b/packages/web/components/patterns/HighlightBar.tsx index ead951168..43160d46c 100644 --- a/packages/web/components/patterns/HighlightBar.tsx +++ b/packages/web/components/patterns/HighlightBar.tsx @@ -1,16 +1,17 @@ -import { Button } from '../elements/Button' -import { HStack, Box } from '../elements/LayoutPrimitives' -import { AnchoredPopover } from '../patterns/AnchoredPopover' -import { StyledText } from '../elements/StyledText' import { highlightBarKeyboardCommands } from '../../lib/keyboardShortcuts/navigationShortcuts' import { useKeyboardShortcuts } from '../../lib/keyboardShortcuts/useKeyboardShortcuts' -import { styled, theme } from '../tokens/stitches.config' -import { PenIcon } from '../elements/images/PenIcon' -import { CommentIcon } from '../elements/images/CommentIcon' -import { ShareIcon } from '../elements/images/ShareIcon' -import { TrashIcon } from '../elements/images/TrashIcon' import { isAndroid } from '../../lib/deviceType' +import { styled, theme } from '../tokens/stitches.config' +import { AnchoredPopover } from '../patterns/AnchoredPopover' + +import { StyledText } from '../elements/StyledText' +import { Button } from '../elements/Button' +import { HStack, Box } from '../elements/LayoutPrimitives' +import { TrashIcon } from '../elements/images/TrashIcon' +import { PenWithColorIcon } from '../elements/images/PenWithColorIcon' +import { Note } from 'phosphor-react' + type PageCoordinates = { pageX: number pageY: number @@ -48,7 +49,9 @@ export function HighlightBar(props: HighlightBarProps): JSX.Element { bottom: 'calc(38px + env(safe-area-inset-bottom, 40px))', '@smDown': { maxWidth: '80%', - bottom: `calc(28px + ${isAndroid() ? 30 : 0}px + env(safe-area-inset-bottom, 40px))`, + bottom: `calc(28px + ${ + isAndroid() ? 30 : 0 + }px + env(safe-area-inset-bottom, 40px))`, }, }} > @@ -62,7 +65,17 @@ export function HighlightBar(props: HighlightBarProps): JSX.Element { yAnchorCoordinate={props.anchorCoordinates.pageY} preventAutoFocus={false} > - + + css= + {{ + width: '350px', + background: '$grayBg', + borderRadius: '4px', + border: '1px solid $grayBorder', + boxShadow: theme.shadows.cardBoxShadow.toString(), + }} + + ) } @@ -116,7 +129,7 @@ function BarContent(props: HighlightBarProps): JSX.Element { }} > - + props.handleButtonClick('delete')} css={{ color: '$readerFont', height: '100%', m: 0, p: 0, pt: '6px' }} > - + )} @@ -149,7 +165,22 @@ function BarContent(props: HighlightBarProps): JSX.Element { onClick={() => props.handleButtonClick('comment')} css={{ color: '$readerFont', height: '100%', m: 0, p: 0, pt: '6px' }} > - + + + + Note + + {/*