mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
add price to preview, default to dynamic
This commit is contained in:
parent
1d55b01398
commit
41b20f59ca
@ -29,5 +29,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.file {
|
.file {
|
||||||
|
}
|
||||||
|
|
||||||
|
.asset {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 4fr;
|
||||||
|
align-items: center;
|
||||||
margin-bottom: calc(var(--spacer) / 2);
|
margin-bottom: calc(var(--spacer) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
}
|
||||||
|
@ -7,6 +7,8 @@ import styles from './Preview.module.css'
|
|||||||
import File from '../../atoms/File'
|
import File from '../../atoms/File'
|
||||||
import { MetadataPublishForm } from '../../../@types/MetaData'
|
import { MetadataPublishForm } from '../../../@types/MetaData'
|
||||||
import Button from '../../atoms/Button'
|
import Button from '../../atoms/Button'
|
||||||
|
import Conversion from '../../atoms/Price/Conversion'
|
||||||
|
import PriceUnit from '../../atoms/Price/PriceUnit'
|
||||||
|
|
||||||
export default function Preview({
|
export default function Preview({
|
||||||
values
|
values
|
||||||
@ -19,15 +21,36 @@ export default function Preview({
|
|||||||
<header>
|
<header>
|
||||||
{values.name && <h3 className={styles.title}>{values.name}</h3>}
|
{values.name && <h3 className={styles.title}>{values.name}</h3>}
|
||||||
{values.description && <Markdown text={values.description} />}
|
{values.description && <Markdown text={values.description} />}
|
||||||
{values.files &&
|
|
||||||
typeof values.files !== 'string' &&
|
<div className={styles.asset}>
|
||||||
values.files.length > 0 && (
|
{values.files?.length > 0 && typeof values.files !== 'string' && (
|
||||||
<File
|
<File
|
||||||
file={values.files[0] as FileMetadata}
|
file={values.files[0] as FileMetadata}
|
||||||
className={styles.file}
|
className={styles.file}
|
||||||
small
|
small
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{values.price && (
|
||||||
|
<div className={styles.price}>
|
||||||
|
<MetaItem
|
||||||
|
title={`Price: ${values.price.type}`}
|
||||||
|
content={
|
||||||
|
<>
|
||||||
|
<PriceUnit
|
||||||
|
price="1"
|
||||||
|
symbol={values.price.datatoken?.symbol}
|
||||||
|
small
|
||||||
|
/>{' '}
|
||||||
|
= <PriceUnit price={`${values.price.price}`} small />
|
||||||
|
<Conversion price={`${values.price.price}`} />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{typeof values.links !== 'string' && values.links?.length && (
|
{typeof values.links !== 'string' && values.links?.length && (
|
||||||
<Button
|
<Button
|
||||||
href={(values.links[0] as FileMetadata).url}
|
href={(values.links[0] as FileMetadata).url}
|
||||||
|
@ -47,7 +47,7 @@ export const initialValues: Partial<MetadataPublishForm> = {
|
|||||||
author: '',
|
author: '',
|
||||||
price: {
|
price: {
|
||||||
price: 1,
|
price: 1,
|
||||||
type: 'fixed',
|
type: 'dynamic',
|
||||||
tokensToMint: 1,
|
tokensToMint: 1,
|
||||||
weightOnDataToken: '9', // 90% on data token
|
weightOnDataToken: '9', // 90% on data token
|
||||||
swapFee: 0.1 // in %
|
swapFee: 0.1 // in %
|
||||||
|
Loading…
x
Reference in New Issue
Block a user