mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
added total orders on teaser (#1570)
This commit is contained in:
parent
42956a3441
commit
1a3d18460f
@ -24,6 +24,8 @@ export default function AssetTeaser({
|
|||||||
const isCompute = Boolean(getServiceByName(asset, 'compute'))
|
const isCompute = Boolean(getServiceByName(asset, 'compute'))
|
||||||
const accessType = isCompute ? 'compute' : 'access'
|
const accessType = isCompute ? 'compute' : 'access'
|
||||||
const { owner } = asset.nft
|
const { owner } = asset.nft
|
||||||
|
const { orders } = asset.stats
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article className={`${styles.teaser} ${styles[type]}`}>
|
<article className={`${styles.teaser} ${styles[type]}`}>
|
||||||
<Link href={`/asset/${asset.id}`}>
|
<Link href={`/asset/${asset.id}`}>
|
||||||
@ -42,6 +44,7 @@ export default function AssetTeaser({
|
|||||||
type={type}
|
type={type}
|
||||||
accessType={accessType}
|
accessType={accessType}
|
||||||
className={styles.typeDetails}
|
className={styles.typeDetails}
|
||||||
|
totalSales={orders}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
|
@ -10,11 +10,13 @@ const cx = classNames.bind(styles)
|
|||||||
export default function AssetType({
|
export default function AssetType({
|
||||||
type,
|
type,
|
||||||
accessType,
|
accessType,
|
||||||
className
|
className,
|
||||||
|
totalSales
|
||||||
}: {
|
}: {
|
||||||
type: string
|
type: string
|
||||||
accessType: string
|
accessType: string
|
||||||
className?: string
|
className?: string
|
||||||
|
totalSales?: number
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const styleClasses = cx({
|
const styleClasses = cx({
|
||||||
[className]: className
|
[className]: className
|
||||||
@ -32,6 +34,10 @@ export default function AssetType({
|
|||||||
<div className={styles.typeLabel}>
|
<div className={styles.typeLabel}>
|
||||||
{type === 'dataset' ? 'data set' : 'algorithm'}
|
{type === 'dataset' ? 'data set' : 'algorithm'}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.typeLabel}>
|
||||||
|
{totalSales + ' ' + (totalSales === 1 ? 'sale' : 'sales')}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user