1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-07-01 06:11:43 +02:00

pricing tab selection fixes

This commit is contained in:
Matthias Kretschmann 2021-10-27 17:56:40 +01:00
parent 928a352975
commit cdbe413765
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 4 additions and 3 deletions

View File

@ -9,4 +9,4 @@ export function useSiteMetadata(): UseSiteMetadata {
} }
return siteMeta return siteMeta
} }

View File

@ -32,7 +32,8 @@ export default function PricingFields(): ReactElement {
// Always update everything when price value changes // Always update everything when price value changes
useEffect(() => { useEffect(() => {
if (type === 'fixed') return if (type === 'fixed' || type === 'free') return
const dtAmount = const dtAmount =
isValidNumber(oceanAmount) && isValidNumber(oceanAmount) &&
isValidNumber(weightOnOcean) && isValidNumber(weightOnOcean) &&
@ -72,7 +73,7 @@ export default function PricingFields(): ReactElement {
<Tabs <Tabs
items={tabs} items={tabs}
handleTabChange={handleTabChange} handleTabChange={handleTabChange}
defaultIndex={type === 'fixed' ? 0 : 1} defaultIndex={type === 'fixed' ? 0 : type === 'dynamic' ? 1 : 2}
className={styles.pricing} className={styles.pricing}
/> />
) )