wip: Further work on development environment
This commit is contained in:
parent
e4756087d8
commit
625baa6d17
10 changed files with 477 additions and 178 deletions
|
@ -3,6 +3,7 @@ import Button from '@material-ui/core/Button'
|
|||
import { FormattedMessage, FormattedHTMLMessage } from 'react-intl'
|
||||
import FormFieldMeasurement from '../../.form/FormFieldMeasurement'
|
||||
import { withBreasts, withoutBreasts } from '@freesewing/models'
|
||||
import Icon from '../../Icon'
|
||||
|
||||
const Measurements = (props) => {
|
||||
const styles = {
|
||||
|
@ -15,8 +16,16 @@ const Measurements = (props) => {
|
|||
chooser: {
|
||||
width: '100%',
|
||||
maxWidth: '500px',
|
||||
margin: 'auto',
|
||||
alignSelf: 'center'
|
||||
alignSelf: 'top'
|
||||
},
|
||||
ul: {
|
||||
listStyleType: 'none',
|
||||
margin: '0',
|
||||
padding: '0'
|
||||
},
|
||||
li: {
|
||||
display: 'inline',
|
||||
padding: '0 5px 5px 0'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,9 +39,6 @@ const Measurements = (props) => {
|
|||
return (
|
||||
<div style={styles.container}>
|
||||
<div style={styles.chooser}>
|
||||
<h2>
|
||||
<FormattedMessage id="app.requiredMeasurements" />
|
||||
</h2>
|
||||
<h3>
|
||||
<FormattedMessage id="cfp.noRequiredMeasurements" />
|
||||
</h3>
|
||||
|
@ -42,7 +48,7 @@ const Measurements = (props) => {
|
|||
<p>
|
||||
<FormattedMessage id="cfp.seeDocsAt" />
|
||||
|
||||
<a href={'https://' + props.language + '/.freesewing.dev/core/config'}>
|
||||
<a href={'https://freesewing.dev/core/config'}>
|
||||
{props.language}
|
||||
.freesewing.dev/core/config
|
||||
</a>
|
||||
|
@ -53,27 +59,36 @@ const Measurements = (props) => {
|
|||
return (
|
||||
<div style={styles.container}>
|
||||
<div style={styles.chooser}>
|
||||
<h2>
|
||||
<FormattedMessage id="app.requiredMeasurements" />
|
||||
</h2>
|
||||
<p>
|
||||
<FormattedMessage id="cfp.youCan" />
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#manual">
|
||||
<FormattedMessage id="cfp.enterMeasurements" />
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#preload">
|
||||
<FormattedMessage id="cfp.preloadMeasurements" />
|
||||
</a>
|
||||
</li>
|
||||
<h4 id="preload">
|
||||
<FormattedMessage id="cfp.preloadMeasurements" />
|
||||
</h4>
|
||||
<ul style={styles.ul}>
|
||||
{Object.keys(withoutBreasts).map((m) => (
|
||||
<li key={`${m}-without`} style={styles.li}>
|
||||
<Button onClick={() => props.preloadMeasurements(withoutBreasts[m])}>
|
||||
<Icon icon="withoutBreasts" />
|
||||
<FormattedMessage id="cfp.size" />
|
||||
|
||||
{m.slice(-2)}
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
{Object.keys(withBreasts).map((m) => (
|
||||
<li key={`${m}-with`} style={styles.li}>
|
||||
<Button onClick={() => props.preloadMeasurements(withBreasts[m])}>
|
||||
<Icon icon="withBreasts" />
|
||||
<FormattedMessage id="cfp.size" />
|
||||
|
||||
{m.slice(-2)}
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<h3 id="manual">
|
||||
</div>
|
||||
<div style={styles.chooser}>
|
||||
<h4 id="manual">
|
||||
<FormattedMessage id="cfp.enterMeasurements" />
|
||||
</h3>
|
||||
</h4>
|
||||
{props.required.map((m) => (
|
||||
<FormFieldMeasurement
|
||||
key={m}
|
||||
|
@ -84,37 +99,6 @@ const Measurements = (props) => {
|
|||
updateValue={props.updateMeasurement}
|
||||
/>
|
||||
))}
|
||||
<h3 id="preload">
|
||||
<FormattedMessage id="cfp.preloadMeasurements" />
|
||||
</h3>
|
||||
<h4>
|
||||
<FormattedMessage id="app.withoutBreasts" />
|
||||
</h4>
|
||||
<ul>
|
||||
{Object.keys(withoutBreasts).map((m) => (
|
||||
<li key={m}>
|
||||
<Button onClick={() => props.preloadMeasurements(withoutBreasts[m])}>
|
||||
<FormattedMessage id="cfp.size" />
|
||||
|
||||
{m.slice(-2)}
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<h4>
|
||||
<FormattedMessage id="app.withBreasts" />
|
||||
</h4>
|
||||
<ul>
|
||||
{Object.keys(withBreasts).map((m) => (
|
||||
<li key={m}>
|
||||
<Button onClick={() => props.preloadMeasurements(withBreasts[m])}>
|
||||
<FormattedMessage id="cfp.size" />
|
||||
|
||||
{m.slice(-2)}
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue