1
0
Fork 0

test view with options menu

This commit is contained in:
Enoch Riese 2023-06-06 13:18:44 -05:00
parent 29d904cd7c
commit ef69ea1e3c
5 changed files with 174 additions and 3 deletions

View file

@ -0,0 +1,48 @@
import { useState } from 'react'
import { PanZoomPattern } from 'shared/components/workbench/pan-zoom-pattern.mjs'
import { TestMenu, ns as menuNs } from './menu.mjs'
import { objUpdate } from 'shared/utils.mjs'
export const ns = []
export const TestView = ({
design,
pattern,
setView,
settings,
ui,
update,
language,
account,
DynamicDocs,
}) => {
if (!pattern) return null
if (settings.sample) pattern.sample()
else pattern.draft()
const renderProps = pattern.getRenderProps()
const patternConfig = pattern.getConfig()
return (
<div className="flex flex-row">
<div className="w-2/3 shrink-0 grow lg:p-4 sticky top-0">
<PanZoomPattern {...{ renderProps }} />
</div>
<div className="w-1/3 shrink grow-0 lg:p-4 max-w-2xl h-screen overflow-scroll">
<TestMenu
{...{
design,
pattern,
patternConfig,
settings,
ui,
update,
language,
account,
DynamicDocs,
renderProps,
}}
/>
</div>
</div>
)
}