1
0
Fork 0

wip(shared): Working on custom layout

This commit is contained in:
Joost De Cock 2022-02-20 18:46:21 +01:00
parent f4ee97a626
commit 34c8a6b2a5
13 changed files with 357 additions and 0 deletions

View file

@ -0,0 +1,33 @@
import Svg from '../draft/svg'
import Defs from '../draft/defs'
import Part from '../draft/part'
const Draft = props => {
const { patternProps, gist, app, updateGist, unsetGist, bgProps={} } = props
return (
<div className="my-8 w-11/12 m-auto">
<Svg {...patternProps} embed={gist.embed}>
<Defs {...patternProps} />
<style>{`:root { --pattern-scale: ${gist.scale || 1}}`}</style>
<g>
<rect x="0" y="0" width={patternProps.width} height={patternProps.height} {...bgProps} />
{Object.keys(patternProps.parts).map((name) => (
<Part
key={name}
partName={name}
part={patternProps.parts[name]}
app={app}
gist={gist}
updateGist={updateGist}
unsetGist={unsetGist}
/>
))}
</g>
</Svg>
</div>
)
}
export default Draft