chore(workbench): move xray to _state in gist
This commit is contained in:
parent
7e5e3b2665
commit
99232fe020
10 changed files with 50 additions and 36 deletions
|
@ -6,8 +6,8 @@ import { getProps } from '../utils'
|
|||
const XrayPart = props => {
|
||||
// Don't bother if this is the only part on display
|
||||
if (props.gist.only && props.gist.only.length === 1) return null
|
||||
const i = props.gist.xray?.reveal
|
||||
? Object.keys(props.gist.xray.reveal).indexOf(props.partName)%10
|
||||
const i = props.gist._state?.xray?.reveal
|
||||
? Object.keys(props.gist._state?.xray.reveal).indexOf(props.partName)%10
|
||||
: 0
|
||||
const { topLeft, bottomRight } = props.part
|
||||
|
||||
|
@ -40,7 +40,11 @@ const Part = props => {
|
|||
return (
|
||||
<g {...getProps(part)} id={`part-${partName}`}>
|
||||
{grid}
|
||||
{props.gist?.xray?.reveal?.[partName] && <XrayPart {...props} />}
|
||||
{
|
||||
props.gist?._state?.xray?.enabled &&
|
||||
props.gist?._state?.xray?.reveal?.[partName]
|
||||
&& <XrayPart {...props} />
|
||||
}
|
||||
{Object.keys(part.paths).map((pathName) => (
|
||||
<Path
|
||||
key={pathName}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue