mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
prepare custom price widget
This commit is contained in:
parent
31f0d57872
commit
aa7fc3c9f0
@ -4,6 +4,7 @@ import styles from './InputElement.module.css'
|
|||||||
import { InputProps } from '.'
|
import { InputProps } from '.'
|
||||||
import FilesInput from '../../molecules/FormFields/FilesInput'
|
import FilesInput from '../../molecules/FormFields/FilesInput'
|
||||||
import Terms from '../../molecules/FormFields/Terms'
|
import Terms from '../../molecules/FormFields/Terms'
|
||||||
|
import Price from '../../molecules/FormFields/Price'
|
||||||
|
|
||||||
export default function InputElement(props: InputProps): ReactElement {
|
export default function InputElement(props: InputProps): ReactElement {
|
||||||
const { type, options, rows, name, value } = props
|
const { type, options, rows, name, value } = props
|
||||||
@ -56,6 +57,8 @@ export default function InputElement(props: InputProps): ReactElement {
|
|||||||
)
|
)
|
||||||
case 'files':
|
case 'files':
|
||||||
return <FilesInput name={name} {...props} />
|
return <FilesInput name={name} {...props} />
|
||||||
|
case 'price':
|
||||||
|
return <Price name={name} {...props} />
|
||||||
case 'terms':
|
case 'terms':
|
||||||
return <Terms name={name} {...props} />
|
return <Terms name={name} {...props} />
|
||||||
default:
|
default:
|
||||||
|
26
src/components/molecules/FormFields/Price/index.module.css
Normal file
26
src/components/molecules/FormFields/Price/index.module.css
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.price {
|
||||||
|
display: flex;
|
||||||
|
gap: calc(var(--spacer) / 2);
|
||||||
|
justify-content: center;
|
||||||
|
background: var(--brand-grey-dimmed);
|
||||||
|
margin-left: -2rem;
|
||||||
|
margin-right: -2rem;
|
||||||
|
padding: calc(var(--spacer) * 1.5) var(--spacer);
|
||||||
|
}
|
||||||
|
|
||||||
|
.price > div {
|
||||||
|
max-width: 8rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price label {
|
||||||
|
color: var(--color-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.price input {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
/* color: var(--brand-white);
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
border-color: var(--brand-grey); */
|
||||||
|
}
|
20
src/components/molecules/FormFields/Price/index.tsx
Normal file
20
src/components/molecules/FormFields/Price/index.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import React, { ReactElement } from 'react'
|
||||||
|
import { InputProps } from '../../../atoms/Input'
|
||||||
|
import InputElement from '../../../atoms/Input/InputElement'
|
||||||
|
import styles from './index.module.css'
|
||||||
|
import Label from '../../../atoms/Input/Label'
|
||||||
|
|
||||||
|
export default function Price(props: InputProps): ReactElement {
|
||||||
|
return (
|
||||||
|
<div className={styles.price}>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="cost">Cost</Label>
|
||||||
|
<InputElement {...props} type="number" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="tokensToMint">Tokens to Mint</Label>
|
||||||
|
<InputElement name="tokensToMint" type="number" min="1" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user