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}>
|
||||
<header className={styles.header}>
|
||||
<div className={styles.symbol}>{datatokens[0]?.symbol}</div>
|
||||
<Dotdotdot clamp={3}>
|
||||
<h1 className={styles.title}>{name}</h1>
|
||||
<Dotdotdot tagName="h1" clamp={3} className={styles.title}>
|
||||
{name}
|
||||
</Dotdotdot>
|
||||
{!noPublisher && (
|
||||
<Publisher account={owner} minimal className={styles.publisher} />
|
||||
|
@ -1,12 +1,9 @@
|
||||
import React, { ReactElement } from 'react'
|
||||
import styles from './index.module.css'
|
||||
import classNames from 'classnames/bind'
|
||||
import Compute from '@images/compute.svg'
|
||||
import Download from '@images/download.svg'
|
||||
import Lock from '@images/lock.svg'
|
||||
|
||||
const cx = classNames.bind(styles)
|
||||
|
||||
export default function AssetType({
|
||||
type,
|
||||
accessType,
|
||||
@ -18,11 +15,8 @@ export default function AssetType({
|
||||
className?: string
|
||||
totalSales?: number
|
||||
}): ReactElement {
|
||||
const styleClasses = cx({
|
||||
[className]: className
|
||||
})
|
||||
return (
|
||||
<div className={styleClasses}>
|
||||
<div className={className || null}>
|
||||
{accessType === 'access' ? (
|
||||
<Download role="img" aria-label="Download" className={styles.icon} />
|
||||
) : accessType === 'compute' && type === 'algorithm' ? (
|
||||
@ -35,9 +29,11 @@ export default function AssetType({
|
||||
{type === 'dataset' ? 'data set' : 'algorithm'}
|
||||
</div>
|
||||
|
||||
<div className={styles.typeLabel}>
|
||||
{totalSales + ' ' + (totalSales === 1 ? 'sale' : 'sales')}
|
||||
</div>
|
||||
{totalSales ? (
|
||||
<div className={styles.typeLabel}>
|
||||
{`${totalSales} ${totalSales === 1 ? 'sale' : 'sales'}`}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user