feat(dev): Added react docs for Pattern + refactor
This adds support for not only documenating components, but also constants and functions that may be exported next to components.
This commit is contained in:
parent
d0baf7cece
commit
22a89f12d3
50 changed files with 1816 additions and 669 deletions
|
@ -1,8 +1,16 @@
|
|||
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import React from 'react'
|
||||
import { getProps } from './utils.mjs'
|
||||
|
||||
/**
|
||||
* A component to render a FreeSewing Snippet in a pattern
|
||||
*
|
||||
* @component
|
||||
* @param {object} props - All component props
|
||||
* @param {object} props.snippet - The snippet object itself
|
||||
* @param {object} props.settings - The pattern settings object
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
export const Snippet = ({ snippet, settings }) => {
|
||||
if (!snippet?.anchor || !snippet.def) return null
|
||||
if (!settings[0].complete && !snippet.attributes.list?.['data-force']?.[0]) return null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue