diff --git a/.gitignore b/.gitignore index 363166d7..3041ce20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -**/.vscode \ No newline at end of file +**/.vscode +yarn-error.log \ No newline at end of file diff --git a/package.json b/package.json index 4af1d87a..f832a4c0 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "target": "", "scripts": { + "dev": "vite", "serve": "vite", "build": "run-p type-check build-only", "preview": "vite preview", @@ -28,6 +29,7 @@ "@vueuse/core": "^9.12.0", "@vueuse/math": "^9.12.0", "apexcharts": "^3.37.1", + "autoprefixer": "^10.4.14", "axios": "^1.3.2", "cross-fetch": "^3.1.5", "dayjs": "^1.11.7", @@ -36,11 +38,16 @@ "numeral": "^2.0.6", "osmojs": "^14.0.0-rc.0", "pinia": "^2.0.28", + "postcss": "^8.4.23", + "prismjs": "^1.29.0", + "tailwindcss": "^3.3.1", "vite-plugin-vue-layouts": "^0.7.0", "vite-plugin-vuetify": "^1.0.2", "vue": "^3.2.45", + "vue-flatpickr-component": "^11.0.3", "vue-i18n": "^9.2.2", "vue-json-pretty": "^2.2.4", + "vue-prism-component": "^2.0.0", "vue-router": "^4.1.6", "vue3-apexcharts": "^1.4.1", "vue3-flip-countdown": "^0.1.6", @@ -69,7 +76,7 @@ "unplugin-auto-import": "^0.13.0", "unplugin-vue-components": "^0.23.0", "unplugin-vue-define-options": "1.1.4", - "vite": "^4.0.0", + "vite": "^4.3.1", "vite-plugin-pages": "^0.28.0", "vue-tsc": "^1.0.12" } diff --git a/packages/dashboard/src/components/ProposalProcess.vue b/packages/dashboard/src/components/ProposalProcess.vue index 09b5d065..28d3e823 100644 --- a/packages/dashboard/src/components/ProposalProcess.vue +++ b/packages/dashboard/src/components/ProposalProcess.vue @@ -1,58 +1,67 @@ \ No newline at end of file + diff --git a/packages/dashboard/src/modules/[chain]/index.vue b/packages/dashboard/src/modules/[chain]/index.vue index 50552a46..06b2437c 100644 --- a/packages/dashboard/src/modules/[chain]/index.vue +++ b/packages/dashboard/src/modules/[chain]/index.vue @@ -124,7 +124,7 @@ function shortName(name: string, id: string) { - + {{ tag }} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 00000000..33ad091d --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/src/components/ProposalListItem.vue b/src/components/ProposalListItem.vue index cef0985c..149c3b55 100644 --- a/src/components/ProposalListItem.vue +++ b/src/components/ProposalListItem.vue @@ -6,57 +6,60 @@ import ProposalProcess from './ProposalProcess.vue'; import type { PropType } from 'vue'; const props = defineProps({ - proposals: { type: Object as PropType}, -}) + proposals: { type: Object as PropType }, +}); // const list = computed(()=> proposl) -const format = useFormatter() -const staking = useStakingStore() -const chain = useBlockchain() -function showType(v: string){ - if(v) { - return v.substring(v.lastIndexOf('.')+1) - } - return v +const format = useFormatter(); +const staking = useStakingStore(); +const chain = useBlockchain(); +function showType(v: string) { + if (v) { + return v.substring(v.lastIndexOf('.') + 1); + } + return v; } + +const statusMap: Record = { + PROPOSAL_STATUS_VOTING_PERIOD: 'VOTING', + PROPOSAL_STATUS_PASSED: 'PASSED', + PROPOSAL_STATUS_REJECTED: 'REJECTED', +}; \ No newline at end of file +
+ +
+
#{{ item?.proposal_id }}
+ +
+ {{ item?.content?.title }} +
+ +
+
+ {{ showType(item.content['@type']) }} +
+
+ +
+
+
{{ statusMap?.[item?.status] || item?.status }}
+
+ +
+ {{ format.toDay(item.voting_end_time, 'from') }} +
+
+ +
+
+ diff --git a/src/components/ProposalProcess.vue b/src/components/ProposalProcess.vue index 82fd26e2..23a1e9d2 100644 --- a/src/components/ProposalProcess.vue +++ b/src/components/ProposalProcess.vue @@ -2,52 +2,36 @@ import { useFormatter } from '@/stores'; import type { Tally } from '@/types'; import { computed } from '@vue/reactivity'; -import { ref, type PropType } from 'vue'; - +import type { PropType } from 'vue'; const props = defineProps({ - tally: { type: Object as PropType}, + tally: { type: Object as PropType }, pool: { type: Object as PropType<{ - not_bonded_tokens: string; - bonded_tokens: string; + not_bonded_tokens: string; + bonded_tokens: string; }>, }, -}) -const total = computed(() => props.pool?.bonded_tokens) -const format = useFormatter() -const yes = computed(() => (format.calculatePercent(props.tally?.yes, total.value))) -const no = computed(() => ref(format.calculatePercent(props.tally?.no, total.value))) -const abstain = computed(() => (format.calculatePercent(props.tally?.abstain, total.value))) -const veto = computed(() => (format.calculatePercent(props.tally?.no_with_veto, total.value))) - +}); +const total = computed(() => props.pool?.bonded_tokens); +const format = useFormatter(); +const yes = computed(() => format.calculatePercent(props.tally?.yes, total.value)); +const no = computed(() => format.calculatePercent(props.tally?.no, total.value)); +const abstain = computed(() => format.calculatePercent(props.tally?.abstain, total.value)); +const veto = computed(() => format.calculatePercent(props.tally?.no_with_veto, total.value)); + \ No newline at end of file + diff --git a/src/layouts/components/DefaultLayout.vue b/src/layouts/components/DefaultLayout.vue index b4373bf3..309525fc 100644 --- a/src/layouts/components/DefaultLayout.vue +++ b/src/layouts/components/DefaultLayout.vue @@ -1,41 +1,42 @@