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
|
||||
useEffect(() => {
|
||||
if (field.value.name !== '') return
|
||||
|
||||
generateName()
|
||||
}, [])
|
||||
}, [field.value.name])
|
||||
|
||||
return (
|
||||
<div className={styles.datatoken}>
|
||||
|
@ -18,7 +18,7 @@ export default function Coin({
|
||||
weight: string
|
||||
readOnly?: boolean
|
||||
}): ReactElement {
|
||||
const [field, meta] = useField(name)
|
||||
const [field, meta] = useField(`pricing.${name}`)
|
||||
|
||||
return (
|
||||
<div className={styles.coin}>
|
||||
|
@ -36,7 +36,7 @@ export default function Fees({
|
||||
tooltips: { [key: string]: string }
|
||||
pricingType: 'dynamic' | 'fixed'
|
||||
}): ReactElement {
|
||||
const [field, meta] = useField('swapFee')
|
||||
const [field, meta] = useField('pricing.swapFee')
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -14,7 +14,7 @@ export default function Price({
|
||||
firstPrice?: string
|
||||
free?: boolean
|
||||
}): ReactElement {
|
||||
const [field, meta] = useField('price')
|
||||
const [field, meta] = useField('pricing.price')
|
||||
|
||||
const { values } = useFormikContext<FormPublishData>()
|
||||
const { dataTokenOptions } = values.services[0]
|
||||
|
@ -19,6 +19,8 @@ export default function PricingFields(): ReactElement {
|
||||
const { pricing } = values
|
||||
const { price, oceanAmount, weightOnOcean, weightOnDataToken, type } = pricing
|
||||
|
||||
console.log(pricing)
|
||||
|
||||
// Switch type value upon tab change
|
||||
function handleTabChange(tabName: string) {
|
||||
const type = tabName.toLowerCase()
|
||||
|
Loading…
Reference in New Issue
Block a user