-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrow.tsx
More file actions
59 lines (55 loc) · 1.81 KB
/
Copy pathrow.tsx
File metadata and controls
59 lines (55 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { prettyQuantity } from 'lib/pretty'
import Image from 'next/image'
import { Asset } from 'lib/types'
import FilterButton from 'components/buttons/filter'
import TradeButton from 'components/buttons/trade'
import ProgressBar from 'components/progress'
import LeftToMint from 'components/progress/leftToMint'
interface AssetRowProps {
asset: Asset
balance: number
}
const AssetRow = ({ asset, balance }: AssetRowProps) => {
const disabled = !(asset.isAvailable && asset.id)
return (
<div className={`is-box has-pink-border row ${disabled && `disabled`}`}>
<div className="columns level">
<div className="column is-flex is-3">
<div className="pr-4">
<Image alt="asset logo" height={60} src={asset.icon} width={40} />
</div>
<div className="is-purple my-auto">
<p className="is-size-6 mb-0">{asset.name}</p>
<p className="is-size-6 mb-0 has-text-weight-bold">
{prettyQuantity(balance, asset.precision)} {asset.ticker}
</p>
</div>
</div>
<div className="column is-4">
{asset.maxCirculatingSupply ? <ProgressBar asset={asset} /> : ''}
</div>
<div className="column is-1">
{asset.maxCirculatingSupply ? <LeftToMint asset={asset} /> : ''}
</div>
<div className="column is-4 has-text-right">
{disabled ? (
<p className="is-size-6 has-text-weight-bold has-text-right mr-3">
Coming soon
</p>
) : (
<>
<TradeButton hash={asset.id} />
<FilterButton ticker={asset.ticker} />
</>
)}
</div>
</div>
<style jsx>{`
.disabled {
opacity: 0.5;
}
`}</style>
</div>
)
}
export default AssetRow