1
0
Fork 0

chore(workbench): move xray to _state in gist

This commit is contained in:
Joost De Cock 2022-02-20 19:02:25 +01:00
parent 7e5e3b2665
commit 99232fe020
10 changed files with 50 additions and 36 deletions

View file

@ -1,3 +1,4 @@
import { useEffect } from 'react'
import { useTranslation } from 'next-i18next'
import Settings from './settings'
import Draft from '../draft'
@ -9,6 +10,14 @@ const addPages = (gist) => {
const PrintLayout = props => {
useEffect(() => {
if (props.gist?._state?.xray?.enabled) props.updateGist(
['_state', 'xray', 'enabled'],
false
)
}, [])
const { t } = useTranslation(['workbench'])
const draft = new props.pattern(props.gist).use(pluginBuilder(

View file

@ -12,7 +12,7 @@ const PrintLayoutSettings = props => {
<div className="flex flex-row gap-4 justify-center">
<PageSizePicker {...props} />
<OrientationPicker {...props} />
<pre>{JSON.stringify(props.gist._state, null ,2)}</pre>
<pre>{JSON.stringify(props.gist, null ,2)}</pre>
</div>
)
}