Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
prevetal committed Feb 3, 2024
1 parent 2ea2050 commit 7460ee0
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 84 deletions.
94 changes: 47 additions & 47 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@cosmjs/tendermint-rpc": "^0.29.0",
"@cybercongress/cyber-js": "^0.3.3",
"@kyvg/vue3-notification": "^2.7.0",
"@vueuse/core": "^10.2.1",
"@vueuse/core": "^10.7.2",
"chart.js": "^4.2.1",
"core-js": "^3.8.3",
"detect.js": "^2.2.3",
Expand Down
36 changes: 11 additions & 25 deletions src/components/proposal/VotesInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -449,25 +449,6 @@
scrollbar-width: thin;
}
.scroll::-webkit-scrollbar
{
width: 6px;
height: 6px;
}
.scroll::-webkit-scrollbar
{
width: 4px;
height: 4px;
background-color: var(--bg);
}
.scroll::-webkit-scrollbar-thumb
{
border-radius: 5px;
background-color: #950fff;
}
.titles
{
Expand Down Expand Up @@ -961,9 +942,7 @@
margin-bottom: 0;
}
.scroll:not(.with_your_validator) .item:first-child .validator .moniker .tooltip:before,
.scroll:not(.with_your_validator) .item:first-child .bar .tooltip:before,
.item.first .validator .moniker .tooltip:before,
.item.first .validator .moniker .tooltip:before
.item.first .bar .tooltip:before
{
top: auto;
Expand Down Expand Up @@ -1025,12 +1004,20 @@
}
.table_wrap .community_votes:hover .tooltip
.item .community_votes:hover .tooltip
{
display: flex;
}
.item .percents
{
justify-content: flex-end;
text-align: right;
}
@media print, (max-width: 1023px)
{
Expand All @@ -1057,6 +1044,5 @@
{
max-height: 304px;
}
}
}
</style>
28 changes: 17 additions & 11 deletions src/views/Proposal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@
<section class="proposal_info" v-else>
<div class="cont middle">
<div class="back_btn">
<router-link :to="router.options.history.state.back ? router.options.history.state.back : '/proposals/cosmoshub?demo=true'" class="btn" v-if="store.demo">
<router-link :to="`/proposals/${store.currentNetwork}?demo=true`" class="btn" v-if="store.demo">
<svg class="icon"><use xlink:href="@/assets/sprite.svg#ic_arrow_hor"></use></svg>
</router-link>

<router-link :to="router.options.history.state.back ? router.options.history.state.back : '/proposals/cosmoshub'" class="btn" v-else>
<router-link :to="`'/proposals/${store.currentNetwork}`" class="btn" v-else>
<svg class="icon"><use xlink:href="@/assets/sprite.svg#ic_arrow_hor"></use></svg>
</router-link>
</div>

<!-- <pre>{{ proposal }}</pre> -->
<!-- <pre>{{ currentVote }}</pre> -->
<!-- <pre>{{ stakingPool }}</pre> -->

<div class="row">
<div class="data">
Expand All @@ -28,11 +25,11 @@

<div class="tabs" v-if="proposal.status != 'PROPOSAL_STATUS_DEPOSIT_PERIOD'">
<div class="row">
<button class="btn" :class="{ active: activeTab == 'tab1' }" @click="activeTab = 'tab1'">
<button class="btn" :class="{ active: activeTab == 'tab1' }" @click="setActiveTab('tab1')">
{{ $t('message.proposal_tab1') }}
</button>

<button v-if="proposal.status == 'PROPOSAL_STATUS_VOTING_PERIOD'" class="btn" :class="{ active: activeTab == 'tab2' }" @click="activeTab = 'tab2'">
<button v-if="proposal.status == 'PROPOSAL_STATUS_VOTING_PERIOD'" class="btn" :class="{ active: activeTab == 'tab2' }" @click="setActiveTab('tab2')">
{{ $t('message.proposal_tab2') }}
</button>
</div>
Expand Down Expand Up @@ -62,9 +59,9 @@
<script setup>
import { onBeforeMount, inject, ref, reactive } from 'vue'
import { useGlobalStore } from '@/stores'
import { useRouter, useRoute } from 'vue-router'
import { fromBech32, toBech32 } from '@cosmjs/encoding'
import { generateAddress } from '@/utils'
import { useUrlSearchParams } from '@vueuse/core'
// Components
import HeadInfo from '../components/proposal/HeadInfo.vue'
Expand All @@ -75,13 +72,12 @@
var store = useGlobalStore(),
router = useRouter(),
route = useRoute(),
i18n = inject('i18n'),
loading = ref(true),
emitter = inject('emitter'),
urlParams = useUrlSearchParams('history'),
proposal = ref({}),
activeTab = ref(route.query.tab ? route.query.tab : 'tab1'),
activeTab = ref(urlParams.tab ? urlParams.tab : 'tab1'),
chartDatasets = reactive([]),
currentVote = reactive({ votes: [] }),
stakingPool = ref({})
Expand Down Expand Up @@ -179,6 +175,16 @@
}
// Set active tab
function setActiveTab(tab) {
// Change tab
activeTab.value = tab
// Set params to URL
urlParams.tab = value
}
// Event "refresh Proposal Data"
emitter.on('refreshProposalData', async () => {
// Clear data
Expand Down

0 comments on commit 7460ee0

Please sign in to comment.