basic editor interface
This commit is contained in:
parent
57dc0e929b
commit
ed3f0abf23
3 changed files with 123 additions and 1 deletions
|
@ -19,6 +19,7 @@ import { DraftLogs } from 'shared/components/workbench/logs.mjs'
|
|||
import { CutLayout } from 'shared/components/workbench/layout/cut/index.mjs'
|
||||
import { PrintLayout } from 'shared/components/workbench/layout/print/index.mjs'
|
||||
|
||||
|
||||
const views = {
|
||||
measurements: WorkbenchMeasurements,
|
||||
draft: LabDraft,
|
||||
|
@ -29,6 +30,7 @@ const views = {
|
|||
logs: DraftLogs,
|
||||
yaml: GistAsYaml,
|
||||
json: GistAsJson,
|
||||
edit: Edit,
|
||||
welcome: () => <p>TODO</p>,
|
||||
}
|
||||
|
||||
|
@ -76,7 +78,7 @@ export const WorkbenchWrapper = ({
|
|||
// force view to measurements
|
||||
useEffect(() => {
|
||||
if (!gistReady) return
|
||||
if (gist._state?.view !== 'measurements' && !hasRequiredMeasurements)
|
||||
if (!['measurements', 'edit'].includes(gist._state?.view) && !hasRequiredMeasurements)
|
||||
updateGist(['_state', 'view'], 'measurements')
|
||||
}, [gistReady, gist._state?.view, hasRequiredMeasurements])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue