mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
make all pricing forms work again, retain data between tabs
This commit is contained in:
parent
c53c7c3093
commit
9960742b37
@ -15,8 +15,10 @@ export default function Datatoken(props: InputProps): ReactElement {
|
|||||||
|
|
||||||
// Generate new DT name & symbol on first mount
|
// Generate new DT name & symbol on first mount
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (field.value.name !== '') return
|
||||||
|
|
||||||
generateName()
|
generateName()
|
||||||
}, [])
|
}, [field.value.name])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.datatoken}>
|
<div className={styles.datatoken}>
|
||||||
|
@ -18,7 +18,7 @@ export default function Coin({
|
|||||||
weight: string
|
weight: string
|
||||||
readOnly?: boolean
|
readOnly?: boolean
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const [field, meta] = useField(name)
|
const [field, meta] = useField(`pricing.${name}`)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.coin}>
|
<div className={styles.coin}>
|
||||||
|
@ -36,7 +36,7 @@ export default function Fees({
|
|||||||
tooltips: { [key: string]: string }
|
tooltips: { [key: string]: string }
|
||||||
pricingType: 'dynamic' | 'fixed'
|
pricingType: 'dynamic' | 'fixed'
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const [field, meta] = useField('swapFee')
|
const [field, meta] = useField('pricing.swapFee')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -14,7 +14,7 @@ export default function Price({
|
|||||||
firstPrice?: string
|
firstPrice?: string
|
||||||
free?: boolean
|
free?: boolean
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const [field, meta] = useField('price')
|
const [field, meta] = useField('pricing.price')
|
||||||
|
|
||||||
const { values } = useFormikContext<FormPublishData>()
|
const { values } = useFormikContext<FormPublishData>()
|
||||||
const { dataTokenOptions } = values.services[0]
|
const { dataTokenOptions } = values.services[0]
|
||||||
|
@ -19,6 +19,8 @@ export default function PricingFields(): ReactElement {
|
|||||||
const { pricing } = values
|
const { pricing } = values
|
||||||
const { price, oceanAmount, weightOnOcean, weightOnDataToken, type } = pricing
|
const { price, oceanAmount, weightOnOcean, weightOnDataToken, type } = pricing
|
||||||
|
|
||||||
|
console.log(pricing)
|
||||||
|
|
||||||
// Switch type value upon tab change
|
// Switch type value upon tab change
|
||||||
function handleTabChange(tabName: string) {
|
function handleTabChange(tabName: string) {
|
||||||
const type = tabName.toLowerCase()
|
const type = tabName.toLowerCase()
|
||||||
|
Loading…
Reference in New Issue
Block a user