diff --git a/src/components/atoms/Input/index.tsx b/src/components/atoms/Input/index.tsx index 9b6002df2..5e5ad85b6 100644 --- a/src/components/atoms/Input/index.tsx +++ b/src/components/atoms/Input/index.tsx @@ -10,7 +10,7 @@ const cx = classNames.bind(styles) export interface InputProps { name: string - label?: string + label?: string | ReactNode placeholder?: string required?: boolean help?: string @@ -54,8 +54,7 @@ export default function Input(props: Partial): ReactElement { } = props const hasError = - props.form?.touched[field.name] && - typeof props.form.errors[field.name] === 'string' + props.form?.touched[field.name] && props.form?.errors[field.name] const styleClasses = cx({ field: true, @@ -72,7 +71,7 @@ export default function Input(props: Partial): ReactElement { - {field && ( + {field && field.name !== 'price' && (
diff --git a/src/components/molecules/FormFields/Price/Coin.tsx b/src/components/molecules/FormFields/Price/Coin.tsx index 65c420ccb..97731b479 100644 --- a/src/components/molecules/FormFields/Price/Coin.tsx +++ b/src/components/molecules/FormFields/Price/Coin.tsx @@ -6,24 +6,23 @@ import { ReactComponent as Logo } from '../../../../images/logo.svg' import Conversion from '../../../atoms/Price/Conversion' import { DataTokenOptions } from '@oceanprotocol/react' import RefreshName from './RefreshName' +import { useField } from 'formik' export default function Coin({ datatokenOptions, name, - value, weight, - onOceanChange, generateName, readOnly }: { datatokenOptions: DataTokenOptions name: string - value: string weight: string - onOceanChange?: (event: ChangeEvent) => void generateName?: () => void readOnly?: boolean }): ReactElement { + const [field, meta, helpers] = useField(name) + return (
@@ -43,15 +42,15 @@ export default function Coin({
{datatokenOptions?.symbol === 'OCEAN' && ( - + )}
diff --git a/src/components/molecules/FormFields/Price/Dynamic.tsx b/src/components/molecules/FormFields/Price/Dynamic.tsx index c82030e97..84d11c4c5 100644 --- a/src/components/molecules/FormFields/Price/Dynamic.tsx +++ b/src/components/molecules/FormFields/Price/Dynamic.tsx @@ -15,22 +15,18 @@ export default function Dynamic({ ocean, priceOptions, datatokenOptions, - onOceanChange, - onLiquidityProviderFeeChange, generateName, content }: { ocean: string priceOptions: PriceOptions datatokenOptions: DataTokenOptions - onOceanChange: (event: ChangeEvent) => void - onLiquidityProviderFeeChange: (event: ChangeEvent) => void generateName: () => void content: any }): ReactElement { const { appConfig } = useSiteMetadata() const { account, balance, chainId, refreshBalance } = useOcean() - const { weightOnDataToken, tokensToMint, liquidityProviderFee } = priceOptions + const { weightOnDataToken } = priceOptions const [error, setError] = useState() const correctNetwork = isCorrectNetwork(chainId) @@ -77,33 +73,25 @@ export default function Dynamic({

- Data Token Liquidity Pool{' '} - + Datatoken Liquidity Pool

- +