From 935a7f58a742ddebe03e962aeddca6ac8179db29 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sat, 8 Feb 2020 15:05:38 -0800 Subject: [PATCH] Remove previously loaded scenes (#734) As mentioned in #724, the current implementation is suboptimal. Let's remove it until we come back with a better design. Fixes #724 --- src/components/StoredScenesList.tsx | 33 --------------------- src/index.tsx | 19 ------------ src/locales/en.json | 1 - src/locales/es.json | 3 +- src/locales/fr.json | 1 - src/locales/nb-no.json | 1 - src/locales/pl.json | 1 - src/locales/pt.json | 1 - src/locales/ru.json | 3 +- src/scene/data.ts | 45 +---------------------------- src/scene/index.ts | 2 -- src/scene/types.ts | 6 ---- src/styles.scss | 9 ------ 13 files changed, 3 insertions(+), 122 deletions(-) delete mode 100644 src/components/StoredScenesList.tsx diff --git a/src/components/StoredScenesList.tsx b/src/components/StoredScenesList.tsx deleted file mode 100644 index 184fb563..00000000 --- a/src/components/StoredScenesList.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React from "react"; -import { PreviousScene } from "../scene/types"; -import { t } from "../i18n"; - -interface StoredScenesListProps { - scenes: PreviousScene[]; - currentId?: string; - onChange: (selectedId: string, k?: string) => {}; -} - -export function StoredScenesList({ - scenes, - currentId, - onChange, -}: StoredScenesListProps) { - return ( - - ); -} diff --git a/src/index.tsx b/src/index.tsx index 7026209f..065e3d17 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -31,7 +31,6 @@ import { hasStroke, hasText, exportCanvas, - loadedScenes, loadScene, calculateScrollCenter, loadFromBlob, @@ -96,7 +95,6 @@ import { ExportDialog } from "./components/ExportDialog"; import { LanguageList } from "./components/LanguageList"; import { Point } from "roughjs/bin/geometry"; import { t, languages, setLanguage, getLanguage } from "./i18n"; -import { StoredScenesList } from "./components/StoredScenesList"; import { HintViewer } from "./components/HintViewer"; import { copyToAppClipboard, getClipboardContent } from "./clipboard"; @@ -318,22 +316,6 @@ const LayerUI = React.memo( ); } - function renderIdsDropdown() { - const scenes = loadedScenes(); - if (scenes.length === 0) { - return; - } - return ( - - actionManager.updater(await loadScene(id, k)) - } - /> - ); - } - return ( <> @@ -400,7 +382,6 @@ const LayerUI = React.memo( languages={languages} currentLanguage={language} /> - {renderIdsDropdown()} {appState.scrolledOutside && (