Skip to content

Commit

Permalink
Update 31.01.2024
Browse files Browse the repository at this point in the history
  • Loading branch information
prevetal committed Jan 31, 2024
1 parent 2ee2af2 commit 2ea2050
Show file tree
Hide file tree
Showing 13 changed files with 256 additions and 224 deletions.
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"core-js": "^3.8.3",
"detect.js": "^2.2.3",
"gh-pages": "^4.0.0",
"hc-sticky": "^2.2.7",
"html-to-image": "^1.11.11",
"marked": "^5.0.2",
"mitt": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ button
z-index: 9;

display: flex;
overflow: hidden;
overflow: clip;
flex-direction: column;

min-width: 360px;
Expand Down
20 changes: 9 additions & 11 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@
header .info
{
align-content: center;
align-items: center;
justify-content: space-between;
min-height: 105px;
padding: 11px 20px;
border-radius: 42px;
align-content: center;
align-items: center;
justify-content: space-between;
}
Expand All @@ -147,13 +147,12 @@
header .logo .btn
{
display: flex;
cursor: pointer;
justify-content: flex-start;
align-items: center;
align-content: center;
align-items: center;
flex-wrap: wrap;
justify-content: flex-start;
cursor: pointer;
}
Expand Down Expand Up @@ -198,15 +197,14 @@
header .logo .mini_modal a
{
color: currentColor;
display: block;
padding: 6px 10px 6px 4px;
transition: background .2s linear;
text-decoration: none;
color: currentColor;
border-radius: 8px;
}
Expand Down
29 changes: 15 additions & 14 deletions src/components/account/Networks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
<style scoped>
.networks
{
position: sticky;
top: 118px;
padding: 14px;
border-radius: 20px;
Expand All @@ -64,15 +67,14 @@
line-height: 36px;
display: flex;
align-content: center;
align-items: center;
flex-wrap: wrap;
justify-content: flex-start;
margin-bottom: 20px;
pointer-events: none;
justify-content: flex-start;
align-items: center;
align-content: center;
flex-wrap: wrap;
}
.networks .title > *
Expand Down Expand Up @@ -107,21 +109,20 @@
.networks .network
{
display: flex;
align-content: center;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
width: 100%;
text-decoration: none;
color: currentColor;
padding: 10px;
transition: background .2s linear;
text-align: left;
text-decoration: none;
color: currentColor;
border-radius: 14px;
justify-content: space-between;
align-items: center;
align-content: center;
flex-wrap: wrap;
}
Expand Down Expand Up @@ -172,13 +173,14 @@
.networks .token
{
color: #555;
font-size: 12px;
line-height: 15px;
margin-top: 6px;
text-transform: uppercase;
color: #555;
}
Expand Down Expand Up @@ -299,5 +301,4 @@
line-height: 26px;
}
}
</style>
10 changes: 6 additions & 4 deletions src/components/account/ProposalsItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@

<div class="progress" v-if="props.proposal.status == 'PROPOSAL_STATUS_DEPOSIT_PERIOD'">
<div class="bar">
<div class="violet" :style="`width: ${$filters.toFixed(props.proposal.deposit / Math.pow(10, store.networks[store.currentNetwork].exponent) / store.networks[store.currentNetwork].proposal_need * 100, 2)}%;`"></div>
<div class="violet" :style="`width: ${$filters.toFixed(formatTokenAmount(props.proposal.deposit, store.networks[store.currentNetwork].token_name) / store.networks[store.currentNetwork].proposal_need * 100, 2)}%;`"></div>
</div>

<div class="funds">
<div>
<div class="label">{{ $t('message.proposal_deposite_label_collected') }}</div>

<div class="val">
{{ $filters.toFixed(props.proposal.deposit / Math.pow(10, store.networks[store.currentNetwork].exponent), 0) }}
{{ store.networks[store.currentNetwork].token_name }}
{{ $filters.toFixed(formatTokenAmount(props.proposal.deposit, store.networks[store.currentNetwork].token_name), 0) }}
{{ formatTokenName(store.networks[store.currentNetwork].token_name) }}
</div>
</div>

Expand All @@ -69,7 +69,7 @@

<div class="val">
{{ store.networks[store.currentNetwork].proposal_need }}
{{ store.networks[store.currentNetwork].token_name }}
{{ formatTokenName(store.networks[store.currentNetwork].token_name) }}
</div>
</div>
</div>
Expand Down Expand Up @@ -148,6 +148,8 @@
<script setup>
import { useGlobalStore } from '@/stores'
import { formatTimeAgo } from '@vueuse/core'
import { formatTokenName, formatTokenAmount } from '@/utils'
const store = useGlobalStore(),
props = defineProps(['proposal']),
Expand Down
83 changes: 75 additions & 8 deletions src/components/account/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</div>

<div class="val" v-else>
{{ '~' + $filters.toFixed(store.account.totalTokensPrice, 2) }}
{{ '~' + totalTokensPrice }}

<div class="currency">{{ store.currentCurrency }}</div>
</div>
Expand Down Expand Up @@ -79,8 +79,9 @@
const store = useGlobalStore(),
loading = store.demo ? ref(false) : ref(true),
totalRewardTokens = !store.demo ? ref(0) : ref(10.016),
APR = !store.demo ? ref(0) : ref(0.2125),
totalRewardTokens = !store.demo ? ref(0) : ref(10.016),
totalTokensPrice = !store.demo ? ref(0) : ref(150.18),
RPDE = !store.demo ? ref(0) : ref(0.4)
Expand All @@ -105,9 +106,14 @@
// Set loader
loading.value = true
// Reset data
APR.value = 0
totalTokensPrice.value = 0
RPDE.value = 0
store.account.info.RPDE = 0
for (const wallet of store.account.wallets) {
// Reset data
wallet.RPDE = 0
// Get network data
Expand All @@ -129,28 +135,89 @@
store.account.info.RPDE += wallet.RPDE
}
// Set current APR
if (store.currentNetwork != 'all') {
// Get current walllet
let currentWallet = {}
store.account.currentWallet != 'all'
? currentWallet = store.account.wallets.find(el => el.address == store.account.currentWallet)
: currentWallet = store.account.wallets[0]
// Get current network
let currentNetwork = currentWallet.networks.find(el => el.name == store.currentNetwork)
// Set current APR
APR.value = currentNetwork.info.apr
}
// Set current RPDE
if (store.account.currentWallet != 'all') {
// Current wallet
let currentWallet = store.account.wallets.find(el => el.address == store.account.currentWallet)
RPDE.value = currentWallet.RPDE
// Set current passport value
if (store.account.currentWallet == 'all') {
if (store.currentNetwork == 'all') {
// Account RPDE
totalTokensPrice.value = store.account.totalTokensPrice
} else {
store.account.wallets.forEach(wallet => {
// Network
let network = wallet.networks.find(el => el.name == store.currentNetwork)
// Sum network in all wallets Total tokens price
totalTokensPrice.value += network.totalTokensPrice
})
}
} else {
if (store.currentNetwork == 'all') {
// Get current walllet
let currentWallet = store.account.wallets.find(el => el.address == store.account.currentWallet)
// Current wallet Total tokens price
RPDE.value = currentWallet.totalTokensPrice
} else {
// Get current walllet
let currentWallet = store.account.wallets.find(el => el.address == store.account.currentWallet)
// Get current network
let currentNetwork = currentWallet.networks.find(el => el.name == store.currentNetwork)
// Current network Total tokens price
totalTokensPrice.value = currentNetwork.totalTokensPrice
}
}
// Set current RPDE
if (store.account.currentWallet == 'all') {
if (store.currentNetwork == 'all') {
// Account RPDE
RPDE.value = store.account.info.RPDE
} else {
store.account.wallets.forEach(wallet => {
// Network
let network = wallet.networks.find(el => el.name == store.currentNetwork)
// Sum network in all wallets RPDE
RPDE.value += network.info.RPDE
})
}
} else {
RPDE.value = store.account.info.RPDE
if (store.currentNetwork == 'all') {
// Get current walllet
let currentWallet = store.account.wallets.find(el => el.address == store.account.currentWallet)
// Current wallet RPDE
RPDE.value = currentWallet.RPDE
} else {
// Get current walllet
let currentWallet = store.account.wallets.find(el => el.address == store.account.currentWallet)
// Get current network
let currentNetwork = currentWallet.networks.find(el => el.name == store.currentNetwork)
// Current network RPDE
RPDE.value = currentNetwork.info.RPDE
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/account/Validators.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
</div>

<div class="amount">
<span>{{ $filters.toFixed(validator.coin.amount / Math.pow(10, store.networks[store.currentNetwork].exponent), 3) }}</span>
{{ store.networks[store.currentNetwork].token_name }}
<span>{{ $filters.toFixed(formatTokenAmount(validator.coin.amount, store.networks[store.currentNetwork].token_name), 3) }}</span>
{{ formatTokenName(store.networks[store.currentNetwork].token_name) }}
</div>
</div>

Expand Down Expand Up @@ -125,7 +125,7 @@
<script setup>
import { onBeforeMount, reactive, ref, inject, watch, computed } from 'vue'
import { useGlobalStore } from '@/stores'
import { generateAddress } from '@/utils'
import { generateAddress, formatTokenName, formatTokenAmount } from '@/utils'
// Demo data
import DemoAccountValidators from '@/demo/AccountValidators.json'
Expand Down
Loading

0 comments on commit 2ea2050

Please sign in to comment.