From ef02919e5e7a4c20d536713961101f3bf382468c Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 24 Jul 2020 09:13:38 +0200 Subject: [PATCH] add conversion, tweak default values --- src/components/atoms/Price/Conversion.module.css | 2 +- .../molecules/FormFields/Price/index.module.css | 2 ++ .../molecules/FormFields/Price/index.tsx | 16 +++++++++------- src/components/pages/Publish/validation.ts | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/atoms/Price/Conversion.module.css b/src/components/atoms/Price/Conversion.module.css index 1dedb014e..21c71782d 100644 --- a/src/components/atoms/Price/Conversion.module.css +++ b/src/components/atoms/Price/Conversion.module.css @@ -1,6 +1,6 @@ .conversion { display: inline-block; - font-size: var(--font-size-mini); + font-size: var(--font-size-small); margin-left: calc(var(--spacer) / 6); color: var(--color-secondary); } diff --git a/src/components/molecules/FormFields/Price/index.module.css b/src/components/molecules/FormFields/Price/index.module.css index d943a7dec..7ad682b21 100644 --- a/src/components/molecules/FormFields/Price/index.module.css +++ b/src/components/molecules/FormFields/Price/index.module.css @@ -25,6 +25,7 @@ .simpleInput { display: flex; justify-content: center; + align-items: center; margin-bottom: calc(var(--spacer) / 2); } @@ -35,6 +36,7 @@ .prefix { border: 1px solid var(--brand-grey-lighter); + min-height: 43px; display: flex; align-items: center; padding-left: calc(var(--spacer) / 2); diff --git a/src/components/molecules/FormFields/Price/index.tsx b/src/components/molecules/FormFields/Price/index.tsx index 50f412539..f5dc9fbf3 100644 --- a/src/components/molecules/FormFields/Price/index.tsx +++ b/src/components/molecules/FormFields/Price/index.tsx @@ -7,6 +7,7 @@ import { useFormikContext } from 'formik' import { MetadataPublishForm } from '../../../../@types/MetaData' import Tabs from '../../../atoms/Tabs' import FormHelp from '../../../atoms/Input/Help' +import Conversion from '../../../atoms/Price/Conversion' export default function Price(props: InputProps): ReactElement { const { values } = useFormikContext() @@ -21,11 +22,14 @@ export default function Price(props: InputProps): ReactElement { value={ ((values as MetadataPublishForm).price && (values as MetadataPublishForm).price.cost) || - '' + 0 } name="price.cost" type="number" /> + {props.help} @@ -38,9 +42,8 @@ export default function Price(props: InputProps): ReactElement {