|
3 | 3 | --> |
4 | 4 | <script lang="ts"> |
5 | 5 | import Breadcrumbs from '$lib/breadcrumb/Breadcrumbs.svelte'; |
| 6 | + import Button from '$lib/components/Button.svelte'; |
| 7 | + import HeroBanner from '$lib/components/HeroBanner.svelte'; |
| 8 | + import Section from '$lib/components/Section.svelte'; |
| 9 | + import { chains } from '$lib/helpers/chain'; |
6 | 10 | import { getLogoUrl } from '$lib/helpers/assets'; |
7 | | - import { formatAmount } from '$lib/helpers/formatters'; |
8 | | - import { Button, ContentCard, ContentCardsSection, ContentCardsTemplate, HeroBanner } from '$lib/components'; |
9 | | -
|
10 | | - export let data; |
11 | 11 | </script> |
12 | 12 |
|
13 | 13 | <svelte:head> |
|
17 | 17 |
|
18 | 18 | <Breadcrumbs labels={{ blockchains: 'Blockchains' }} /> |
19 | 19 |
|
20 | | -<ContentCardsTemplate pageTitle="DEX trading view" pageDescription="DEX trading view"> |
21 | | - <HeroBanner slot="hero" title="Blockchains" subtitle="List of currently active blockchains producing trading data." /> |
22 | | - |
23 | | - <ContentCardsSection cols={4} --button-width="100%"> |
24 | | - {#each data.chains as chain} |
25 | | - <ContentCard href={`/trading-view/${chain.chain_slug}`} testId="chain-{chain.chain_id}-{chain.chain_slug}"> |
26 | | - <img |
27 | | - slot="icon" |
28 | | - class="blockchain-logo" |
29 | | - alt={`${chain.chain_name} logo`} |
30 | | - src={getLogoUrl('blockchain', chain.chain_slug)} |
31 | | - /> |
32 | | - <h3 slot="title" class="blockchain-title">{chain.chain_name}</h3> |
33 | | - <p>{formatAmount(chain.exchanges)} exchanges</p> |
34 | | - <Button label="Details" /> |
35 | | - </ContentCard> |
36 | | - {/each} |
37 | | - </ContentCardsSection> |
38 | | -</ContentCardsTemplate> |
| 20 | +<main class="blockchains-page"> |
| 21 | + <Section> |
| 22 | + <HeroBanner title="Blockchains" subtitle="List of currently active blockchains producing trading data." /> |
| 23 | + </Section> |
| 24 | + |
| 25 | + <Section> |
| 26 | + <div class="chains"> |
| 27 | + {#each chains as chain (chain.id)} |
| 28 | + <a class="tile b" href={`/trading-view/${chain.slug}`}> |
| 29 | + <img class="tile c" alt={`${chain.name} logo`} src={getLogoUrl('blockchain', chain.slug)} /> |
| 30 | + <h3>{chain.name}</h3> |
| 31 | + <Button>View details</Button> |
| 32 | + </a> |
| 33 | + {/each} |
| 34 | + </div> |
| 35 | + </Section> |
| 36 | +</main> |
39 | 37 |
|
40 | 38 | <style> |
41 | | - .blockchain-logo { |
42 | | - height: 3rem; |
43 | | - width: 3rem; |
44 | | - } |
| 39 | + .chains { |
| 40 | + display: grid; |
| 41 | + grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); |
| 42 | + gap: 1.5rem; |
| 43 | + margin-top: 1rem; |
| 44 | +
|
| 45 | + a { |
| 46 | + display: grid; |
| 47 | + padding: 1.5rem; |
| 48 | + gap: 1rem; |
| 49 | + justify-items: center; |
| 50 | + --button-width: clamp(10rem, 50%, 15rem); |
| 51 | + } |
| 52 | +
|
| 53 | + img { |
| 54 | + height: 5rem; |
| 55 | + width: 5rem; |
| 56 | + border-radius: 50%; |
| 57 | + margin-bottom: 0.5rem; |
| 58 | + padding: 1rem; |
| 59 | + } |
45 | 60 |
|
46 | | - h3.blockchain-title { |
47 | | - font: var(--f-heading-md-medium); |
| 61 | + h3 { |
| 62 | + font: var(--f-heading-md-medium); |
| 63 | + } |
48 | 64 | } |
49 | 65 | </style> |
0 commit comments