From 8a5a287661c04dbd4be3d2e569ff4969c06a12e4 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 3 Mar 2023 21:44:54 +0800 Subject: [PATCH] Add vertical article actions --- .../article/VerticalArticleActions.tsx | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 packages/web/components/templates/article/VerticalArticleActions.tsx diff --git a/packages/web/components/templates/article/VerticalArticleActions.tsx b/packages/web/components/templates/article/VerticalArticleActions.tsx new file mode 100644 index 000000000..93028ec99 --- /dev/null +++ b/packages/web/components/templates/article/VerticalArticleActions.tsx @@ -0,0 +1,189 @@ +import { Separator } from '@radix-ui/react-separator' +import { + ArchiveBox, + DotsThree, + DotsThreeOutline, + HighlighterCircle, + Info, + TagSimple, + TextAa, + Trash, + Tray, +} from 'phosphor-react' +import { ArticleAttributes } from '../../../lib/networking/queries/useGetArticleQuery' +import { Button } from '../../elements/Button' +import { Box, HStack, SpanBox } from '../../elements/LayoutPrimitives' +import { TooltipWrapped } from '../../elements/Tooltip' +import { styled, theme } from '../../tokens/stitches.config' +import { useReaderSettings } from '../../../lib/hooks/useReaderSettings' +import { useRef } from 'react' +import { setLabelsMutation } from '../../../lib/networking/mutations/setLabelsMutation' +import { Label } from '../../../lib/networking/fragments/labelFragment' +import { SetLabelsModal } from './SetLabelsModal' + +export type ArticleActionsMenuLayout = 'top' | 'side' + +type ArticleActionsMenuProps = { + article?: ArticleAttributes + layout: ArticleActionsMenuLayout + showReaderDisplaySettings?: boolean + articleActionHandler: (action: string, arg?: unknown) => void +} + +export function VerticalArticleActionsMenu( + props: ArticleActionsMenuProps +): JSX.Element { + return ( + <> + + + + + + + + + + {!props.article?.isArchived ? ( + + ) : ( + + )} + + + + + + ) +}