diff --git a/src/components/App.tsx b/src/components/App.tsx index c56559d..692079f 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,14 +1,13 @@ // Portions of this file are Copyright 2021 Google LLC, and licensed under GPL2+. See COPYING. -import React, { CSSProperties, forwardRef, useContext, useEffect, useRef, useState } from 'react'; -import {MultiLayoutComponentId, SingleLayoutComponentId, State} from '../state/app-state' +import React, { CSSProperties, useEffect, useState } from 'react'; +import {MultiLayoutComponentId, State} from '../state/app-state' import { Model } from '../state/model'; -import { TabMenu } from 'primereact/tabmenu'; -import { ToggleButton } from 'primereact/togglebutton'; import EditorPanel from './EditorPanel'; import ViewerPanel from './ViewerPanel'; import Footer from './Footer'; import { ModelContext, FSContext } from './contexts'; +import PanelSwitcher from './PanelSwitcher'; // import "primereact/resources/themes/lara-light-indigo/theme.css"; // import "primereact/resources/primereact.min.css"; @@ -20,14 +19,6 @@ export function App({initialState, fs}: {initialState: State, fs: FS}) { const model = new Model(fs, state, setState); useEffect(() => model.init()); - const singleTargets: {id: SingleLayoutComponentId, icon: string, label: string}[] = [ - { id: 'editor', icon: 'pi pi-pencil', label: 'Edit' }, - { id: 'viewer', icon: 'pi pi-box', label: 'View' }, - { id: 'customizer', icon: 'pi pi-sliders-h', label: 'Customize' }, - // { id: 'customizer', icon: 'pi pi-cog', label: 'Customize' }, - ]; - const multiTargets = singleTargets; - const zIndexOfPanelsDependingOnFocus = { editor: { editor: 3, @@ -63,7 +54,7 @@ export function App({initialState, fs}: {initialState: State, fs: FS}) { } } } - + // TODO: test this again: // body { // min-height: 100vh; @@ -75,6 +66,7 @@ export function App({initialState, fs}: {initialState: State, fs: FS}) { // height: -webkit-fill-available; // } const isIPhone = /iPhone/.test(navigator.userAgent) + return ( @@ -84,46 +76,8 @@ export function App({initialState, fs}: {initialState: State, fs: FS}) { height: isIPhone ? "calc(100vh - 80px - env(safe-area-inset-bottom) - env(safe-area-inset-top))" : '100vh' }}> {isIPhone &&