From 46f8388aa1a9064db8e3f953d0786ff31d30263f Mon Sep 17 00:00:00 2001 From: shamilkhan Date: Wed, 27 Sep 2023 12:54:21 +0400 Subject: [PATCH 1/6] Add FIAT conversion component. --- frontend/assets/scss/themes/polkastats.scss | 52 +++++++++ frontend/components/Chain.vue | 7 +- frontend/components/FIATConversion.vue | 121 ++++++++++++++++++++ 3 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 frontend/components/FIATConversion.vue diff --git a/frontend/assets/scss/themes/polkastats.scss b/frontend/assets/scss/themes/polkastats.scss index 3d5677b5..86c9adce 100644 --- a/frontend/assets/scss/themes/polkastats.scss +++ b/frontend/assets/scss/themes/polkastats.scss @@ -635,3 +635,55 @@ section .section-title { background-position: 10% 20%; } } + +// FIAT conversion component + +.fiat-conversion { + font-size: 0.8rem; + margin-left: 0.4rem; + padding: 0.2rem 0.4rem; + background-color: rgb(192, 229, 243); + border-radius: 0.2rem; + cursor: pointer; + animation-duration: 0.6s; + color: rgb(11, 129, 168); +} +.fiat-conversion:hover { + background-color: rgb(11, 129, 168); + color: white; + animation-name: onHoverAnimation; +} + +@keyframes onHoverAnimation { + 0% { + background-color: rgb(192, 229, 243); + } + 100% { + background-color: rgb(11, 129, 168); + } +} + +.fiat-conversion-short { + cursor: pointer; +} +.fiat-conversion-short .fa-circle { + color: rgb(192, 229, 243) !important; +} +.fiat-conversion-short .fa-dollar-sign { + color: rgb(11, 129, 168); +} +.fiat-conversion-short:hover .fa-circle { + color: rgb(11, 129, 168) !important; +} +.fiat-conversion-short:hover .fa-dollar-sign { + color: white; +} + +.dropdown-item { + color: rgba(0, 0, 0, 0.5); + font-size: 0.9rem; +} + +.dropdown-item.active, .dropdown-item:active { + color: rgba(0, 0, 0, 0.9); +} diff --git a/frontend/components/Chain.vue b/frontend/components/Chain.vue index c3b2a63a..0df0d1da 100644 --- a/frontend/components/Chain.vue +++ b/frontend/components/Chain.vue @@ -112,6 +112,7 @@
{{ formatAmount(totalIssuance) }} +
@@ -126,7 +127,9 @@ {{ $t('components.network.total_staked') }}
- {{ formatAmount(totalStaked) }} + {{ formatAmount(totalStaked, 0, true) }} + + ({{ formatNumber(totalStakedPercentage) }}%)
@@ -176,8 +179,10 @@ import { gql } from 'graphql-tag' import BN from 'bn.js' import commonMixin from '../mixins/commonMixin.js' import { network } from '../frontend.config.js' +import FIATConversion from '@/components/FIATConversion' export default { + components: [FIATConversion], mixins: [commonMixin], data() { return { diff --git a/frontend/components/FIATConversion.vue b/frontend/components/FIATConversion.vue new file mode 100644 index 00000000..891cd46f --- /dev/null +++ b/frontend/components/FIATConversion.vue @@ -0,0 +1,121 @@ + + From 957e8848474a019948dc7ad3d73023ab57e90e00 Mon Sep 17 00:00:00 2001 From: shamilkhan Date: Wed, 27 Sep 2023 13:08:22 +0400 Subject: [PATCH 2/6] Update Search UI --- frontend/components/Search.vue | 30 ++++++++++++++++++------------ frontend/locales/en.json | 3 +++ frontend/locales/es.json | 3 +++ frontend/pages/index.vue | 1 + 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/frontend/components/Search.vue b/frontend/components/Search.vue index c4a9c34b..6f1d73cb 100644 --- a/frontend/components/Search.vue +++ b/frontend/components/Search.vue @@ -1,20 +1,26 @@