From e03da2475dad5108089a621fdaa68b7bf75f5934 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 29 Dec 2022 17:37:52 +0800 Subject: [PATCH] Update setlabels to save on close, always use the modal --- .../templates/article/ArticleActionsMenu.tsx | 98 +++++++++++++------ .../templates/article/HighlightsLayer.tsx | 2 - .../templates/article/HighlightsModal.tsx | 2 +- .../templates/article/SetLabelsControl.tsx | 47 +++------ .../templates/article/SetLabelsModal.tsx | 41 +++----- .../templates/homeFeed/HomeFeedContainer.tsx | 2 +- .../web/pages/[username]/[slug]/index.tsx | 2 +- 7 files changed, 102 insertions(+), 92 deletions(-) diff --git a/packages/web/components/templates/article/ArticleActionsMenu.tsx b/packages/web/components/templates/article/ArticleActionsMenu.tsx index 195f176ff..d1037a957 100644 --- a/packages/web/components/templates/article/ArticleActionsMenu.tsx +++ b/packages/web/components/templates/article/ArticleActionsMenu.tsx @@ -20,6 +20,7 @@ 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' @@ -102,12 +103,7 @@ export function ArticleActionsMenu( tooltipContent="Adjust Display Settings" tooltipSide={props.layout == 'side' ? 'right' : 'bottom'} > - - - + @@ -122,37 +118,56 @@ export function ArticleActionsMenu( }} > {props.article ? ( - + + + ) : ( + // + // + // + // } + // > + // { + // if (props.article?.id) { + // return setLabelsMutation( + // props.article?.id, + // labels.map((label) => label.id) + // ) + // } + // return Promise.resolve(undefined) + // }} + // onLabelsChanged={(labels) => { + // props.articleActionHandler('refreshLabels', labels) + // }} + // /> + //