diff --git a/src/components/atoms/Table/index.tsx b/src/components/atoms/Table/index.tsx index 08fd14c82..0a2fe5e38 100644 --- a/src/components/atoms/Table/index.tsx +++ b/src/components/atoms/Table/index.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { ReactElement } from 'react' import DataTable from 'react-data-table-component' export declare type AssetTablePagination = { diff --git a/src/components/molecules/FormFields/Price/Advanced.module.css b/src/components/molecules/FormFields/Price/Advanced.module.css index 226db2e6a..aeddcd7ff 100644 --- a/src/components/molecules/FormFields/Price/Advanced.module.css +++ b/src/components/molecules/FormFields/Price/Advanced.module.css @@ -1,13 +1,10 @@ .advanced { } -.advanced > div:last-child { - display: grid; - gap: calc(var(--spacer) / 2); - grid-template-columns: 1fr 1fr 1fr; -} - .wallet > button { - margin: calc(var(--spacer) / 2) auto var(--spacer) auto; + margin: var(--spacer) auto calc(var(--spacer) / 2) auto; display: block; } + +.tokens { +} diff --git a/src/components/molecules/FormFields/Price/Advanced.tsx b/src/components/molecules/FormFields/Price/Advanced.tsx index 9a311ab5c..31aa21ba4 100644 --- a/src/components/molecules/FormFields/Price/Advanced.tsx +++ b/src/components/molecules/FormFields/Price/Advanced.tsx @@ -9,15 +9,17 @@ import Cost from './Cost' import Conversion from '../../../atoms/Price/Conversion' import FormHelp from '../../../atoms/Input/Help' import Wallet from '../../Wallet' +import { useOcean } from '@oceanprotocol/react' export default function Advanced(props: InputProps): ReactElement { const { price } = props.form.values as MetadataPublishForm + const { balance } = useOcean() const cost = '1' - const weight = '90' // in % + const weightOnDataToken = '90' // in % - const [ocean, setOcean] = useState('1') - const tokensToMint = Number(ocean) * (Number(weight) / 100) + const [ocean, setOcean] = useState('10') + const tokensToMint = Number(ocean) * (Number(weightOnDataToken) / 10) function handleOceanChange(event: ChangeEvent) { setOcean(event.target.value) @@ -35,56 +37,47 @@ export default function Advanced(props: InputProps): ReactElement { -
-
- - - - - -
- -
- - -
- -
- - -
- -
- - - -
-
+ + + + + + + + + + + + + + + + + + + + + + +
AssetWeightAmountValue
OCEAN{`${100 - Number(weightOnDataToken)}%`} + + + +
OCEAN-CAVIAR{`${weightOnDataToken}%`} + + +
{/* Hidden to fields to actually collect form values for Formik state */} diff --git a/src/global/styles.css b/src/global/styles.css index a63445413..b372381f2 100644 --- a/src/global/styles.css +++ b/src/global/styles.css @@ -132,6 +132,28 @@ fieldset { margin: 0; } +table { + width: 100%; + border-collapse: collapse; + display: block; + overflow: auto; + -webkit-overflow-scrolling: touch; +} + +table th, +table td { + border: 0; + margin: 0; + padding: calc(var(--spacer) / 2); + border-bottom: 1px solid var(--brand-grey-lighter); + text-align: left; + font-size: 90%; +} + +table th { + font-weight: var(--font-weight-bold); +} + @import '_code.css'; @import '_toast.css'; @import '_web3modal.css';