forked from SoulSwapFinance/soul-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
61 lines (58 loc) · 2.18 KB
/
index.tsx
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
60
61
import Search from 'components/Search'
import { getChainColorCode } from 'constants/chains'
import AnalyticsContainer from 'features/analytics/AnalyticsContainer'
import Background from 'features/analytics/Background'
import useTokensAnalytics from 'features/analytics/hooks/useTokensAnalytics'
import TokenList from 'features/analytics/Tokens/TokenList'
import useFuse from 'hooks/useFuse'
import Link from 'next/link'
import React from 'react'
import { useActiveWeb3React } from 'services/web3'
export default function Tokens() {
const tokens = useTokensAnalytics()
const { chainId } = useActiveWeb3React()
const {
result: tokensSearched,
term,
search,
} = useFuse({
data: tokens,
options: {
keys: ['token.id', 'token.symbol', 'token.name'],
threshold: 0.4,
},
})
return (
<AnalyticsContainer>
<div className="relative h-8 mt-4">
<div className="absolute w-full h-full bg-gradient-to-r from-blue to-purple opacity-5" />
<div className="absolute flex items-center w-full p-2 lg:pl-14">
<div className="text-xs font-medium text-secondary m-1">
<Link href="/analytics">Dashboard</Link>
</div>
<div className="text-xs font-medium text-secondary m-1">
<Link href="/analytics/coffinbox">CoffinBox</Link>
</div>
<div className="text-xs font-medium text-secondary m-1">
<Link href="/analytics/pairs">Pairs</Link>
</div>
<div className={`text-xs font-bold text-high-emphesis m-1 text-${getChainColorCode(chainId)}`}>
Tokens
</div>
</div>
</div>
<Background background="tokens">
<div className="grid items-center justify-between grid-cols-1 gap-x-4 gap-y-4 md:grid-cols-2">
<div>
<div className="text-3xl font-bold text-high-emphesis">Tokens</div>
<div>Click headers to sort by price, liquidity, or volume.</div>
</div>
<Search term={term} search={search} />
</div>
</Background>
<div className="px-4 pt-4 lg:px-14">
<TokenList tokens={tokensSearched} />
</div>
</AnalyticsContainer>
)
}