feat: Dashboard Active Proposals

This commit is contained in:
Alisa | Side.one 2023-05-08 22:17:02 +08:00
parent 78678bf064
commit 4ea1402840

View File

@ -2,6 +2,7 @@
import MdEditor from 'md-editor-v3'; import MdEditor from 'md-editor-v3';
import PriceMarketChart from '@/components/charts/PriceMarketChart.vue'; import PriceMarketChart from '@/components/charts/PriceMarketChart.vue';
import { Icon } from '@iconify/vue';
import { useBlockchain, useFormatter } from '@/stores'; import { useBlockchain, useFormatter } from '@/stores';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { useIndexModule } from './indexStore'; import { useIndexModule } from './indexStore';
@ -38,6 +39,29 @@ function shortName(name: string, id: string) {
? id ? id
: name; : name;
} }
const comLinks = [
{
name: 'Website',
icon: 'mdi-web',
href: store.homepage,
},
{
name: 'Twitter',
icon: 'mdi-twitter',
href: store.twitter,
},
{
name: 'Telegram',
icon: 'mdi-telegram',
href: store.telegram,
},
{
name: 'Github',
icon: 'mdi-github',
href: store.github,
},
];
</script> </script>
<template> <template>
@ -47,51 +71,31 @@ function shortName(name: string, id: string) {
<VCol md="5"> <VCol md="5">
<VCardItem> <VCardItem>
<VCardTitle> <VCardTitle>
{{ coinInfo.name }} ( {{ coinInfo.name }} (<span class="uppercase">{{
<span class="text-uppercase">{{ coinInfo.symbol }}</span> coinInfo.symbol
) }}</span
>)
</VCardTitle> </VCardTitle>
<VCardSubtitle> <VCardSubtitle>
Rank: Rank:
<VChip color="error" size="x-small" <div
>#{{ coinInfo.market_cap_rank }}</VChip class="badge text-xs badge-error bg-[#fcebea] dark:bg-[#41384d] text-red-400"
> >
#{{ coinInfo.market_cap_rank }}
</div>
</VCardSubtitle> </VCardSubtitle>
</VCardItem> </VCardItem>
<VDivider /> <div class="h-[1px] w-full bg-gray-100 dark:bg-[#384059]"></div>
<div class="mt-4 pl-4"> <div class="mt-4 pl-4 flex items-center">
<VBtn <a
variant="text" v-for="(item, index) of comLinks"
size="small" :key="index"
:href="store.homepage" :href="item.href"
prependIcon="mdi-web" class="link link-primary px-2 py-1 rounded-sm no-underline hover:text-primary hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center"
> >
Website <Icon :icon="item?.icon" />
</VBtn> <span class="ml-1 text-sm uppercase">{{ item?.name }}</span>
<VBtn </a>
variant="text"
size="small"
:href="store.twitter"
prependIcon="mdi-twitter"
>
Twitter
</VBtn>
<VBtn
variant="text"
size="small"
:href="store.telegram"
prependIcon="mdi-telegram"
>
Telegram
</VBtn>
<VBtn
variant="text"
size="small"
:href="store.github"
prependIcon="mdi-github"
>
Github
</VBtn>
</div> </div>
<VCardItem> <VCardItem>
<!-- SECTION upgrade plan banner --> <!-- SECTION upgrade plan banner -->
@ -192,17 +196,17 @@ function shortName(name: string, id: string) {
</div> </div>
</div> </div>
<VCard class="my-5"> <div class="bg-base-100 rounded mt-4 shadow">
<VCardItem class="pb-0"> <div class="px-4 pt-4 pb-2 text-lg font-semibold text-secondary">
<VCardTitle>Active Proposals</VCardTitle> Active Proposals
</VCardItem> </div>
<VCardItem> <div class="px-4 pb-4">
<ProposalListItem :proposals="store?.proposals" /> <ProposalListItem :proposals="store?.proposals" />
</VCardItem> </div>
<VCardText v-if="store.proposals.length === 0" <div class="pl-4 pb-8 py-4" v-if="store.proposals?.length === 0">
>No active proposals</VCardText No active proposals
> </div>
</VCard> </div>
<div <div
class="btn btn-primary w-full mt-5 flex items-center bg-transparent text-primary hover:bg-gray-100 hover:bg-transparent" class="btn btn-primary w-full mt-5 flex items-center bg-transparent text-primary hover:bg-gray-100 hover:bg-transparent"