-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michele F. <michele-franchi@users.noreply.github.com>
- Loading branch information
1 parent
8f8e1ac
commit f56a9d4
Showing
7 changed files
with
183 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
describe('ae coin', () => { | ||
it('should display tokens', () => { | ||
cy.visit('/tokens/ae') | ||
|
||
cy.get('.ae-coin-panel table').should('be.visible') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<template> | ||
<app-panel class="ae-coin-panel"> | ||
<table> | ||
<tbody> | ||
<tr class="ae-coin-panel__row"> | ||
<th class="ae-coin-panel__table-header"> | ||
<hint-tooltip> | ||
{{ aeCoinHints.tokenSymbol }} | ||
</hint-tooltip> | ||
Symbol | ||
</th> | ||
<td> | ||
<div class="ae-coin-panel__link"> | ||
<img | ||
class="ae-coin-panel__icon" | ||
alt="æ token" | ||
src="@/assets/ae-token.svg"> | ||
<copy-chip label="AE"/> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr class="ae-coin-panel__row"> | ||
<th class="ae-coin-panel__table-header"> | ||
<hint-tooltip> | ||
{{ aeCoinHints.price }} | ||
</hint-tooltip> | ||
Price | ||
</th> | ||
<td> | ||
$ {{ formatNullable(price) }} | ||
<app-chip | ||
class="market-stats__chip" | ||
:variant="priceChipVariant"> | ||
{{ priceChangeSign }}{{ formatNullable(priceChange) }} % | ||
</app-chip> | ||
</td> | ||
</tr> | ||
<tr class="ae-coin-panel__row"> | ||
<th class="ae-coin-panel__table-header"> | ||
<hint-tooltip> | ||
{{ aeCoinHints.totalSupply }} | ||
</hint-tooltip> | ||
Total Supply | ||
</th> | ||
<td> | ||
{{ formatNullable(formatAePrice(MAX_AE_DISTRIBUTION), 0) }} | ||
</td> | ||
</tr> | ||
<tr class="ae-coin-panel__row"> | ||
<th class="ae-coin-panel__table-header"> | ||
<hint-tooltip> | ||
{{ aeCoinHints.circulating }} | ||
</hint-tooltip> | ||
Circulating Supply | ||
</th> | ||
<td> | ||
{{ formatNullable(formatAePrice(totalTokenSupply), 0) }} | ||
</td> | ||
</tr> | ||
<tr class="ae-coin-panel__row"> | ||
<th class="ae-coin-panel__table-header"> | ||
<hint-tooltip> | ||
{{ aeCoinHints.decimals }} | ||
</hint-tooltip> | ||
Decimals | ||
</th> | ||
<td> | ||
18 | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</app-panel> | ||
</template> | ||
|
||
<script setup> | ||
import { storeToRefs } from 'pinia' | ||
import { useMarketStatsStore } from '@/stores/marketStats' | ||
import { useBlockchainStatsStore } from '@/stores/blockchainStats' | ||
import { formatAePrice, formatNullable } from '@/utils/format' | ||
import { aeCoinHints } from '@/utils/hints/aeCoinHints' | ||
import { MAX_AE_DISTRIBUTION } from '@/utils/constants' | ||
const { price, priceChange } = storeToRefs(useMarketStatsStore()) | ||
const { fetchMarketStats } = useMarketStatsStore() | ||
const { totalTokenSupply } = storeToRefs(useBlockchainStatsStore()) | ||
const { fetchTotalStats } = useBlockchainStatsStore() | ||
await useAsyncData(() => Promise.all([ | ||
fetchTotalStats(), | ||
fetchMarketStats(), | ||
])) | ||
const priceChangeSign = computed(() => { | ||
if (priceChange.value > 0) { | ||
return '+' | ||
} else if (priceChange.value === 0) { | ||
return '' | ||
} else if (priceChange.value < 0) { | ||
return '-' | ||
} | ||
}) | ||
const priceChipVariant = computed(() => priceChange.value > 0 ? 'success' : 'error') | ||
</script> | ||
|
||
<style scoped> | ||
.ae-coin-panel { | ||
&__table-header { | ||
border-bottom: 1px solid var(--color-midnight-25); | ||
@media (--desktop) { | ||
width: var(--detail-column-width); | ||
} | ||
} | ||
&__row:last-of-type &__table-header { | ||
border-bottom: 0; | ||
} | ||
&__link { | ||
display: inline-flex; | ||
align-items: center; | ||
} | ||
&__icon { | ||
margin-right: var(--space-1); | ||
width: 28px; | ||
height: 28px; | ||
@media (--desktop) { | ||
width: 24px; | ||
height: 24px; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<Head> | ||
<Title>AE Coin</Title> | ||
</Head> | ||
|
||
<page-header> | ||
AE Coin | ||
<template #tooltip> | ||
{{ aeCoinHints.aeCoin }} | ||
</template> | ||
</page-header> | ||
<template v-if="!isLoading"> | ||
<ae-coin-panel/> | ||
</template> | ||
<loader-panel v-else/> | ||
</template> | ||
|
||
<script setup> | ||
import PageHeader from '@/components/PageHeader' | ||
import { aeCoinHints } from '@/utils/hints/aeCoinHints' | ||
const { isLoading } = useLoading() | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const aeCoinHints = { | ||
aeCoin: 'æternity native coin.', | ||
tokenSymbol: 'Reserved coin name.', | ||
price: 'Price of the coin in AE and USD.', | ||
totalSupply: 'Amount of tokens that will be mined.', | ||
circulating: 'Amount of distributed coins minus the burned amount.', | ||
decimals: 'The decimal granularity of the coin.', | ||
} |