From 6c47b8e44ef2d5f9f4691142e94e4c7898cb71d3 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 9 Sep 2020 14:58:57 +0200 Subject: [PATCH] fix publishing --- content/pages/publish.json | 8 +++---- ...Advanced.module.css => Dynamic.module.css} | 0 .../Price/{Advanced.tsx => Dynamic.tsx} | 4 ++-- .../{Simple.module.css => Fixed.module.css} | 2 +- .../Price/{Simple.tsx => Fixed.tsx} | 6 ++--- .../molecules/FormFields/Price/index.tsx | 22 +++++++++---------- .../organisms/AssetActions/index.tsx | 2 +- src/models/FormPublish.ts | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-) rename src/components/molecules/FormFields/Price/{Advanced.module.css => Dynamic.module.css} (100%) rename src/components/molecules/FormFields/Price/{Advanced.tsx => Dynamic.tsx} (97%) rename src/components/molecules/FormFields/Price/{Simple.module.css => Fixed.module.css} (80%) rename src/components/molecules/FormFields/Price/{Simple.tsx => Fixed.tsx} (89%) diff --git a/content/pages/publish.json b/content/pages/publish.json index 77a6a7e8c..c73d4c238 100644 --- a/content/pages/publish.json +++ b/content/pages/publish.json @@ -98,12 +98,12 @@ "success": "Asset Created!" }, "price": { - "simple": { - "title": "Simple: Fixed", + "fixed": { + "title": "Fixed", "info": "Set your price for accessing this data set. A Data Token contract for this data set, worth the entered amount of OCEAN will be created." }, - "advanced": { - "title": "Advanced: Dynamic", + "dynamic": { + "title": "Dynamic", "info": "Let's create a decentralized, automated market for your data set. A Data Token contract for this data set worth the entered amount of OCEAN will be created. Additionally, you will provide liquidity into a Data Token/OCEAN liquidity pool with Balancer.", "tooltips": { "poolInfo": "Help me", diff --git a/src/components/molecules/FormFields/Price/Advanced.module.css b/src/components/molecules/FormFields/Price/Dynamic.module.css similarity index 100% rename from src/components/molecules/FormFields/Price/Advanced.module.css rename to src/components/molecules/FormFields/Price/Dynamic.module.css diff --git a/src/components/molecules/FormFields/Price/Advanced.tsx b/src/components/molecules/FormFields/Price/Dynamic.tsx similarity index 97% rename from src/components/molecules/FormFields/Price/Advanced.tsx rename to src/components/molecules/FormFields/Price/Dynamic.tsx index a5c85cd05..a657d0f31 100644 --- a/src/components/molecules/FormFields/Price/Advanced.tsx +++ b/src/components/molecules/FormFields/Price/Dynamic.tsx @@ -1,7 +1,7 @@ import React, { ReactElement, useState, ChangeEvent, useEffect } from 'react' import { graphql, useStaticQuery } from 'gatsby' import stylesIndex from './index.module.css' -import styles from './Advanced.module.css' +import styles from './Dynamic.module.css' import FormHelp from '../../../atoms/Input/Help' import Wallet from '../../Wallet' import { useOcean } from '@oceanprotocol/react' @@ -13,7 +13,7 @@ import InputElement from '../../../atoms/Input/InputElement' import Label from '../../../atoms/Input/Label' import Tooltip from '../../../atoms/Tooltip' -export default function Advanced({ +export default function Dynamic({ ocean, tokensToMint, weightOnDataToken, diff --git a/src/components/molecules/FormFields/Price/Simple.module.css b/src/components/molecules/FormFields/Price/Fixed.module.css similarity index 80% rename from src/components/molecules/FormFields/Price/Simple.module.css rename to src/components/molecules/FormFields/Price/Fixed.module.css index 59027445a..68a1be810 100644 --- a/src/components/molecules/FormFields/Price/Simple.module.css +++ b/src/components/molecules/FormFields/Price/Fixed.module.css @@ -3,6 +3,6 @@ margin: 0 auto; } -.simple label { +.fixed label { display: none; } diff --git a/src/components/molecules/FormFields/Price/Simple.tsx b/src/components/molecules/FormFields/Price/Fixed.tsx similarity index 89% rename from src/components/molecules/FormFields/Price/Simple.tsx rename to src/components/molecules/FormFields/Price/Fixed.tsx index 7b8851a58..23b19b8bb 100644 --- a/src/components/molecules/FormFields/Price/Simple.tsx +++ b/src/components/molecules/FormFields/Price/Fixed.tsx @@ -1,12 +1,12 @@ import React, { ReactElement, ChangeEvent } from 'react' import stylesIndex from './index.module.css' -import styles from './Simple.module.css' +import styles from './Fixed.module.css' import FormHelp from '../../../atoms/Input/Help' import Label from '../../../atoms/Input/Label' import InputElement from '../../../atoms/Input/InputElement' import Conversion from '../../../atoms/Price/Conversion' -export default function Simple({ +export default function Fixed({ ocean, onChange, content @@ -17,7 +17,7 @@ export default function Simple({ }): ReactElement { return (
-
+
{content.info}
diff --git a/src/components/molecules/FormFields/Price/index.tsx b/src/components/molecules/FormFields/Price/index.tsx index e25e65490..a6a659bb7 100644 --- a/src/components/molecules/FormFields/Price/index.tsx +++ b/src/components/molecules/FormFields/Price/index.tsx @@ -3,8 +3,8 @@ import { graphql, useStaticQuery } from 'gatsby' import { InputProps } from '../../../atoms/Input' import styles from './index.module.css' import Tabs from '../../../atoms/Tabs' -import Simple from './Simple' -import Advanced from './Advanced' +import Fixed from './Fixed' +import Dynamic from './Dynamic' import { useField } from 'formik' const query = graphql` @@ -14,11 +14,11 @@ const query = graphql` node { childPagesJson { price { - simple { + fixed { title info } - advanced { + dynamic { title info tooltips { @@ -49,7 +49,7 @@ export default function Price(props: InputProps): ReactElement { } function handleTabChange(tabName: string) { - const type = tabName.startsWith('Simple') ? 'simple' : 'advanced' + const type = tabName.toLowerCase() helpers.setValue({ ...field.value, type }) } @@ -62,25 +62,25 @@ export default function Price(props: InputProps): ReactElement { const tabs = [ { - title: content.simple.title, + title: content.fixed.title, content: ( - ) }, { - title: content.advanced.title, + title: content.dynamic.title, content: ( - ) } diff --git a/src/components/organisms/AssetActions/index.tsx b/src/components/organisms/AssetActions/index.tsx index 5929af9c5..8c173b187 100644 --- a/src/components/organisms/AssetActions/index.tsx +++ b/src/components/organisms/AssetActions/index.tsx @@ -44,7 +44,7 @@ export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement { title: 'Use', content: UseContent }, - (!priceType || priceType === 'advanced') && { + (!priceType || priceType === 'dynamic') && { title: 'Pool', content: } diff --git a/src/models/FormPublish.ts b/src/models/FormPublish.ts index 110cc3a3f..4b393023f 100644 --- a/src/models/FormPublish.ts +++ b/src/models/FormPublish.ts @@ -9,7 +9,7 @@ export const validationSchema = Yup.object().shape({ price: Yup.object().shape({ tokensToMint: Yup.number().required('Required'), type: Yup.string() - .matches(/simple|advanced/g) + .matches(/fixed|dynamic/g) .required('Required'), weightOnDataToken: Yup.string().required('Required'), liquidityProviderFee: Yup.string() @@ -32,7 +32,7 @@ export const initialValues: MetadataPublishForm = { name: '', author: '', price: { - type: 'simple', + type: 'fixed', tokensToMint: 1, weightOnDataToken: '9', // 90% on data token liquidityProviderFee: '0.1' // in %