mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
conditionally output totalSales (#1578)
This commit is contained in:
parent
6ae584212f
commit
f8bbda0594
@ -32,8 +32,8 @@ export default function AssetTeaser({
|
|||||||
<a className={styles.link}>
|
<a className={styles.link}>
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<div className={styles.symbol}>{datatokens[0]?.symbol}</div>
|
<div className={styles.symbol}>{datatokens[0]?.symbol}</div>
|
||||||
<Dotdotdot clamp={3}>
|
<Dotdotdot tagName="h1" clamp={3} className={styles.title}>
|
||||||
<h1 className={styles.title}>{name}</h1>
|
{name}
|
||||||
</Dotdotdot>
|
</Dotdotdot>
|
||||||
{!noPublisher && (
|
{!noPublisher && (
|
||||||
<Publisher account={owner} minimal className={styles.publisher} />
|
<Publisher account={owner} minimal className={styles.publisher} />
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import classNames from 'classnames/bind'
|
|
||||||
import Compute from '@images/compute.svg'
|
import Compute from '@images/compute.svg'
|
||||||
import Download from '@images/download.svg'
|
import Download from '@images/download.svg'
|
||||||
import Lock from '@images/lock.svg'
|
import Lock from '@images/lock.svg'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
|
||||||
|
|
||||||
export default function AssetType({
|
export default function AssetType({
|
||||||
type,
|
type,
|
||||||
accessType,
|
accessType,
|
||||||
@ -18,11 +15,8 @@ export default function AssetType({
|
|||||||
className?: string
|
className?: string
|
||||||
totalSales?: number
|
totalSales?: number
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const styleClasses = cx({
|
|
||||||
[className]: className
|
|
||||||
})
|
|
||||||
return (
|
return (
|
||||||
<div className={styleClasses}>
|
<div className={className || null}>
|
||||||
{accessType === 'access' ? (
|
{accessType === 'access' ? (
|
||||||
<Download role="img" aria-label="Download" className={styles.icon} />
|
<Download role="img" aria-label="Download" className={styles.icon} />
|
||||||
) : accessType === 'compute' && type === 'algorithm' ? (
|
) : accessType === 'compute' && type === 'algorithm' ? (
|
||||||
@ -35,9 +29,11 @@ export default function AssetType({
|
|||||||
{type === 'dataset' ? 'data set' : 'algorithm'}
|
{type === 'dataset' ? 'data set' : 'algorithm'}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{totalSales ? (
|
||||||
<div className={styles.typeLabel}>
|
<div className={styles.typeLabel}>
|
||||||
{totalSales + ' ' + (totalSales === 1 ? 'sale' : 'sales')}
|
{`${totalSales} ${totalSales === 1 ? 'sale' : 'sales'}`}
|
||||||
</div>
|
</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user