From 3c0bc79768e355335896033268ba4bb5ff1d189f Mon Sep 17 00:00:00 2001 From: Laurent Senta Date: Tue, 1 Feb 2022 02:18:14 +0100 Subject: [PATCH] feat: add migration pref pane (#825) * feat: add migration pane * style: clean imports * removeme: beta version * fix: do no show dropzone when tag has no parent * fix: hide the Folders toggle * fix: hide migrations option when user has no folders * fix: add delimiter on Folders mark * removeme: bump beta * fix: remove component viewer for tag folders * removeme: bump beta * chore(deps): snjs --- .../javascripts/components/Navigation.tsx | 64 ++++------- .../QuickSettingsMenu/QuickSettingsMenu.tsx | 10 +- .../components/Tags/RootTagDropZone.tsx | 9 +- .../components/Tags/TagsSectionTitle.tsx | 2 +- .../javascripts/components/menu/MenuItem.tsx | 41 ++++--- .../preferences/components/MenuItem.tsx | 4 +- .../javascripts/preferences/panes/General.tsx | 16 +-- .../panes/general-segments/Migrations.tsx | 103 ++++++++++++++++++ .../ui_models/app_state/app_state.ts | 62 +---------- .../ui_models/app_state/tags_state.ts | 5 + package.json | 2 +- yarn.lock | 8 +- 12 files changed, 181 insertions(+), 145 deletions(-) create mode 100644 app/assets/javascripts/preferences/panes/general-segments/Migrations.tsx diff --git a/app/assets/javascripts/components/Navigation.tsx b/app/assets/javascripts/components/Navigation.tsx index dbf4e027b..3d9eb0691 100644 --- a/app/assets/javascripts/components/Navigation.tsx +++ b/app/assets/javascripts/components/Navigation.tsx @@ -1,4 +1,3 @@ -import { ComponentView } from '@/components/ComponentView'; import { SmartTagsSection } from '@/components/Tags/SmartTagsSection'; import { TagsSection } from '@/components/Tags/TagsSection'; import { WebApplication } from '@/ui_models/application'; @@ -6,13 +5,7 @@ import { PANEL_NAME_NAVIGATION } from '@/views/constants'; import { ApplicationEvent, PrefKey } from '@standardnotes/snjs'; import { observer } from 'mobx-react-lite'; import { FunctionComponent } from 'preact'; -import { - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from 'preact/hooks'; +import { useCallback, useEffect, useMemo, useState } from 'preact/hooks'; import { PremiumModalProvider } from './Premium'; import { PanelSide, @@ -28,7 +21,6 @@ type Props = { export const Navigation: FunctionComponent = observer( ({ application }) => { const appState = useMemo(() => application.getAppState(), [application]); - const componentViewer = appState.foldersComponentViewer; const enableNativeSmartTagsFeature = appState.features.enableNativeSmartTagsFeature; const [ref, setRef] = useState(); @@ -72,42 +64,30 @@ export const Navigation: FunctionComponent = observer( data-aria-label="Navigation" ref={setRef} > - {componentViewer ? ( -
-
- -
-
- ) : ( -