feat(components: Added Legend component
This commit is contained in:
parent
b09ebe5a5e
commit
c3f07dd123
5 changed files with 1867 additions and 1 deletions
1839
packages/components/Legend/index.js
Normal file
1839
packages/components/Legend/index.js
Normal file
File diff suppressed because one or more lines are too long
1
packages/components/Legend/index.js.map
Normal file
1
packages/components/Legend/index.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -52,7 +52,7 @@ const Example = ({
|
|||
}
|
||||
settings = {
|
||||
options: { ...options },
|
||||
measurements: { headCircumference: 390 },
|
||||
measurements: { head: 390 },
|
||||
...settings
|
||||
}
|
||||
if (part !== '') settings.only = [part]
|
||||
|
|
25
packages/components/src/Legend/index.js
Normal file
25
packages/components/src/Legend/index.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
import React from 'react'
|
||||
import LegendPattern from '@freesewing/legend'
|
||||
import Draft from '../Draft'
|
||||
|
||||
const Legend = ({ caption = '', part = '' }) => {
|
||||
const patternProps = new LegendPattern({
|
||||
only: part,
|
||||
measurements: {
|
||||
head: 370
|
||||
}
|
||||
})
|
||||
.draft()
|
||||
.getRenderProps()
|
||||
|
||||
return (
|
||||
<figure>
|
||||
<div className="shadow">
|
||||
<Draft {...patternProps} />
|
||||
</div>
|
||||
<figcaption>{caption}</figcaption>
|
||||
</figure>
|
||||
)
|
||||
}
|
||||
|
||||
export default Legend
|
|
@ -6,6 +6,7 @@ export default [
|
|||
'Example',
|
||||
'Footer',
|
||||
'Icon',
|
||||
'Legend',
|
||||
'LineDrawing',
|
||||
'Logo',
|
||||
'Navbar',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue