From 796976aaf7503ebae168805117bd9ef8d4493a54 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Mon, 1 Jun 2020 13:55:36 +0200 Subject: [PATCH] feat(components): Added antwomen test to SampleConfigurator --- .../src/SampleConfigurator/index.js | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/packages/components/src/SampleConfigurator/index.js b/packages/components/src/SampleConfigurator/index.js index 51259d71887..82e8b7f1a75 100644 --- a/packages/components/src/SampleConfigurator/index.js +++ b/packages/components/src/SampleConfigurator/index.js @@ -2,11 +2,12 @@ import React, { useState } from 'react' import { FormattedMessage } from 'react-intl' import PatternOptions from './PatternOptions' import { withBreasts, withoutBreasts } from '@freesewing/models' +import neckstimate from '@freesewing/utils/neckstimate' -const SampleConfigurator = props => { +const SampleConfigurator = (props) => { const [expanded, setExpanded] = useState([]) - const sampleOption = option => { + const sampleOption = (option) => { props.updateGist( { type: 'option', @@ -17,7 +18,7 @@ const SampleConfigurator = props => { ) } - const sampleMeasurement = measurement => { + const sampleMeasurement = (measurement) => { props.updateGist( { type: 'measurement', @@ -28,7 +29,7 @@ const SampleConfigurator = props => { ) } - const sampleModels = models => { + const sampleModels = (models) => { props.updateGist( { type: 'models', @@ -38,11 +39,22 @@ const SampleConfigurator = props => { 'sample' ) } - let antMan = { - ant: {}, - man: withoutBreasts.manSize42 + const antMan = { ant: {}, b: {}, c: {}, man: {} } + const antWoman = { ant: {}, b: {}, c: {}, woman: {} } + for (let m in withoutBreasts.size42) { + let val = neckstimate(420, m, false) + antMan.ant[m] = val / 10 + antMan.b[m] = val / 5 + antMan.c[m] = val / 2 + antMan.man[m] = val + } + for (let m in withBreasts.size36) { + let val = neckstimate(360, m, true) + antWoman.ant[m] = val / 10 + antWoman.b[m] = val / 5 + antWoman.c[m] = val / 2 + antWoman.woman[m] = val } - for (let m in withoutBreasts.manSize42) antMan.ant[m] = antMan.man[m] / 10 return (