From d7a8beeefb3bf1a9bbb2fa26fd18efa97fa1de29 Mon Sep 17 00:00:00 2001 From: ochafik Date: Mon, 27 Mar 2023 00:20:40 +0100 Subject: [PATCH] Add back-home button as one can stray far from the playground --- src/components/EditorPanel.tsx | 9 +++++++- src/components/FilePicker.tsx | 39 +++++++++++++++++----------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/components/EditorPanel.tsx b/src/components/EditorPanel.tsx index e395f8c..1efbf06 100644 --- a/src/components/EditorPanel.tsx +++ b/src/components/EditorPanel.tsx @@ -8,7 +8,7 @@ import { Button } from 'primereact/button'; import { MenuItem } from 'primereact/menuitem'; import { Menu } from 'primereact/menu'; import { buildUrlForStateParams } from '../state/fragment-state'; -import { blankProjectState } from '../state/initial-state'; +import { blankProjectState, defaultSourcePath } from '../state/initial-state'; import { ModelContext, FSContext } from './contexts'; import FilePicker, { } from './FilePicker'; // import { isFileWritable } from '../state/model'; @@ -170,6 +170,13 @@ export default function EditorPanel({className, style}: {className?: string, sty style={{ flex: 1, }}/> + + {state.params.sourcePath !== defaultSourcePath && +