mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix publishing
This commit is contained in:
parent
b154cfc2ac
commit
6c47b8e44e
@ -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",
|
||||
|
@ -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,
|
@ -3,6 +3,6 @@
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.simple label {
|
||||
.fixed label {
|
||||
display: none;
|
||||
}
|
@ -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 (
|
||||
<div className={stylesIndex.content}>
|
||||
<div className={styles.simple}>
|
||||
<div className={styles.fixed}>
|
||||
<FormHelp className={stylesIndex.help}>{content.info}</FormHelp>
|
||||
|
||||
<div className={styles.form}>
|
@ -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: (
|
||||
<Simple
|
||||
<Fixed
|
||||
ocean={ocean}
|
||||
onChange={handleOceanChange}
|
||||
content={content.simple}
|
||||
content={content.fixed}
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: content.advanced.title,
|
||||
title: content.dynamic.title,
|
||||
content: (
|
||||
<Advanced
|
||||
<Dynamic
|
||||
ocean={ocean}
|
||||
tokensToMint={tokensToMint}
|
||||
weightOnDataToken={weightOnDataToken}
|
||||
onOceanChange={handleOceanChange}
|
||||
liquidityProviderFee={liquidityProviderFee}
|
||||
content={content.advanced}
|
||||
content={content.dynamic}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -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: <Pool ddo={ddo} />
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ export const validationSchema = Yup.object().shape<MetadataPublishForm>({
|
||||
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 %
|
||||
|
Loading…
Reference in New Issue
Block a user