1
0
Fork 0

feat(ds.dev): example is not a shared component

This commit is contained in:
Joost De Cock 2021-12-24 17:13:48 +01:00
parent cbac621186
commit e705da9e7f
18 changed files with 784 additions and 108 deletions

View file

@ -0,0 +1,20 @@
import React from 'react'
import TextOnPath from '../TextOnPath'
import DevelopPath from '../DevelopPath'
import { getProps } from '../utils'
const Path = (props) => {
if (!props.path.render) return null
const output = []
const pathId = 'path-' + props.part + '-' + props.name
if (props.develop) output.push(<DevelopPath {...props} key={'dpa-' + props.name} />)
output.push(
<path id={pathId} key={pathId} d={props.path.asPathstring()} {...getProps(props.path)} />
)
if (props.path.attributes.get('data-text'))
output.push(<TextOnPath key={'text-on-path-' + props.name} pathId={pathId} {...props} />)
return output
}
export default Path