From 2026d8b936e15ef8c444a07bc46d91f6913045f2 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Sun, 27 Nov 2022 23:33:26 +0530 Subject: [PATCH] refactor: note options tag selection menu --- .../Components/NotesOptions/AddTagOption.tsx | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/packages/web/src/javascripts/Components/NotesOptions/AddTagOption.tsx b/packages/web/src/javascripts/Components/NotesOptions/AddTagOption.tsx index 7840c55ed..fe622e96b 100644 --- a/packages/web/src/javascripts/Components/NotesOptions/AddTagOption.tsx +++ b/packages/web/src/javascripts/Components/NotesOptions/AddTagOption.tsx @@ -9,6 +9,7 @@ import { IconType } from '@standardnotes/snjs' import { getTitleForLinkedTag } from '@/Utils/Items/Display/getTitleForLinkedTag' import { useApplication } from '../ApplicationView/ApplicationProvider' import MenuItem from '../Menu/MenuItem' +import Menu from '../Menu/Menu' type Props = { navigationController: NavigationController @@ -53,30 +54,32 @@ const AddTagOption: FunctionComponent = ({ navigationController, notesCon align="start" className="py-2" > - {navigationController.tags.map((tag) => ( - { - notesController.isTagInSelectedNotes(tag) - ? notesController.removeTagFromSelectedNotes(tag).catch(console.error) - : notesController.addTagToSelectedNotes(tag).catch(console.error) - }} - > - {tag.iconString && ( - - )} - + {navigationController.tags.map((tag) => ( + { + notesController.isTagInSelectedNotes(tag) + ? notesController.removeTagFromSelectedNotes(tag).catch(console.error) + : notesController.addTagToSelectedNotes(tag).catch(console.error) + }} > - {getTitleForLinkedTag(tag, application)?.longTitle} - - - ))} + {tag.iconString && ( + + )} + + {getTitleForLinkedTag(tag, application)?.longTitle} + + + ))} + )