1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

fix publishing

This commit is contained in:
Matthias Kretschmann 2020-09-09 14:58:57 +02:00
parent b154cfc2ac
commit 6c47b8e44e
Signed by: m
GPG Key ID: 606EEEF3C479A91F
8 changed files with 24 additions and 24 deletions

View File

@ -98,12 +98,12 @@
"success": "Asset Created!" "success": "Asset Created!"
}, },
"price": { "price": {
"simple": { "fixed": {
"title": "Simple: 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." "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": { "dynamic": {
"title": "Advanced: 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.", "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": { "tooltips": {
"poolInfo": "Help me", "poolInfo": "Help me",

View File

@ -1,7 +1,7 @@
import React, { ReactElement, useState, ChangeEvent, useEffect } from 'react' import React, { ReactElement, useState, ChangeEvent, useEffect } from 'react'
import { graphql, useStaticQuery } from 'gatsby' import { graphql, useStaticQuery } from 'gatsby'
import stylesIndex from './index.module.css' 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 FormHelp from '../../../atoms/Input/Help'
import Wallet from '../../Wallet' import Wallet from '../../Wallet'
import { useOcean } from '@oceanprotocol/react' import { useOcean } from '@oceanprotocol/react'
@ -13,7 +13,7 @@ import InputElement from '../../../atoms/Input/InputElement'
import Label from '../../../atoms/Input/Label' import Label from '../../../atoms/Input/Label'
import Tooltip from '../../../atoms/Tooltip' import Tooltip from '../../../atoms/Tooltip'
export default function Advanced({ export default function Dynamic({
ocean, ocean,
tokensToMint, tokensToMint,
weightOnDataToken, weightOnDataToken,

View File

@ -3,6 +3,6 @@
margin: 0 auto; margin: 0 auto;
} }
.simple label { .fixed label {
display: none; display: none;
} }

View File

@ -1,12 +1,12 @@
import React, { ReactElement, ChangeEvent } from 'react' import React, { ReactElement, ChangeEvent } from 'react'
import stylesIndex from './index.module.css' 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 FormHelp from '../../../atoms/Input/Help'
import Label from '../../../atoms/Input/Label' import Label from '../../../atoms/Input/Label'
import InputElement from '../../../atoms/Input/InputElement' import InputElement from '../../../atoms/Input/InputElement'
import Conversion from '../../../atoms/Price/Conversion' import Conversion from '../../../atoms/Price/Conversion'
export default function Simple({ export default function Fixed({
ocean, ocean,
onChange, onChange,
content content
@ -17,7 +17,7 @@ export default function Simple({
}): ReactElement { }): ReactElement {
return ( return (
<div className={stylesIndex.content}> <div className={stylesIndex.content}>
<div className={styles.simple}> <div className={styles.fixed}>
<FormHelp className={stylesIndex.help}>{content.info}</FormHelp> <FormHelp className={stylesIndex.help}>{content.info}</FormHelp>
<div className={styles.form}> <div className={styles.form}>

View File

@ -3,8 +3,8 @@ import { graphql, useStaticQuery } from 'gatsby'
import { InputProps } from '../../../atoms/Input' import { InputProps } from '../../../atoms/Input'
import styles from './index.module.css' import styles from './index.module.css'
import Tabs from '../../../atoms/Tabs' import Tabs from '../../../atoms/Tabs'
import Simple from './Simple' import Fixed from './Fixed'
import Advanced from './Advanced' import Dynamic from './Dynamic'
import { useField } from 'formik' import { useField } from 'formik'
const query = graphql` const query = graphql`
@ -14,11 +14,11 @@ const query = graphql`
node { node {
childPagesJson { childPagesJson {
price { price {
simple { fixed {
title title
info info
} }
advanced { dynamic {
title title
info info
tooltips { tooltips {
@ -49,7 +49,7 @@ export default function Price(props: InputProps): ReactElement {
} }
function handleTabChange(tabName: string) { function handleTabChange(tabName: string) {
const type = tabName.startsWith('Simple') ? 'simple' : 'advanced' const type = tabName.toLowerCase()
helpers.setValue({ ...field.value, type }) helpers.setValue({ ...field.value, type })
} }
@ -62,25 +62,25 @@ export default function Price(props: InputProps): ReactElement {
const tabs = [ const tabs = [
{ {
title: content.simple.title, title: content.fixed.title,
content: ( content: (
<Simple <Fixed
ocean={ocean} ocean={ocean}
onChange={handleOceanChange} onChange={handleOceanChange}
content={content.simple} content={content.fixed}
/> />
) )
}, },
{ {
title: content.advanced.title, title: content.dynamic.title,
content: ( content: (
<Advanced <Dynamic
ocean={ocean} ocean={ocean}
tokensToMint={tokensToMint} tokensToMint={tokensToMint}
weightOnDataToken={weightOnDataToken} weightOnDataToken={weightOnDataToken}
onOceanChange={handleOceanChange} onOceanChange={handleOceanChange}
liquidityProviderFee={liquidityProviderFee} liquidityProviderFee={liquidityProviderFee}
content={content.advanced} content={content.dynamic}
/> />
) )
} }

View File

@ -44,7 +44,7 @@ export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement {
title: 'Use', title: 'Use',
content: UseContent content: UseContent
}, },
(!priceType || priceType === 'advanced') && { (!priceType || priceType === 'dynamic') && {
title: 'Pool', title: 'Pool',
content: <Pool ddo={ddo} /> content: <Pool ddo={ddo} />
} }

View File

@ -9,7 +9,7 @@ export const validationSchema = Yup.object().shape<MetadataPublishForm>({
price: Yup.object().shape({ price: Yup.object().shape({
tokensToMint: Yup.number().required('Required'), tokensToMint: Yup.number().required('Required'),
type: Yup.string() type: Yup.string()
.matches(/simple|advanced/g) .matches(/fixed|dynamic/g)
.required('Required'), .required('Required'),
weightOnDataToken: Yup.string().required('Required'), weightOnDataToken: Yup.string().required('Required'),
liquidityProviderFee: Yup.string() liquidityProviderFee: Yup.string()
@ -32,7 +32,7 @@ export const initialValues: MetadataPublishForm = {
name: '', name: '',
author: '', author: '',
price: { price: {
type: 'simple', type: 'fixed',
tokensToMint: 1, tokensToMint: 1,
weightOnDataToken: '9', // 90% on data token weightOnDataToken: '9', // 90% on data token
liquidityProviderFee: '0.1' // in % liquidityProviderFee: '0.1' // in %