feat: sidebar style, input search, table hight

This commit is contained in:
Alisa | Side.one 2023-05-28 16:37:37 +08:00
parent 317ca32a1f
commit 5026f5e6be
8 changed files with 524 additions and 359 deletions

View File

@ -1,5 +1,5 @@
{ {
"tabWidth": 4, "tabWidth": 2,
"singleQuote": true, "singleQuote": true,
"semi": true, "semi": true,
"endOfLine": "auto", "endOfLine": "auto",

View File

@ -18,7 +18,7 @@ const header = computed(() => {
}); });
</script> </script>
<template> <template>
<div class="overflow-x-auto p-4"> <div class="overflow-auto h-[500px] p-4">
<div <div
v-if="header.length > 0" v-if="header.length > 0"
class="table table-compact w-full" class="table table-compact w-full"

View File

@ -4,11 +4,16 @@ import { select } from './index';
const props = defineProps(['value']); const props = defineProps(['value']);
</script> </script>
<template> <template>
<div class="overflow-x-auto"> <div class="overflow-auto">
<table class="table table-compact w-full text-sm"> <table class="table table-compact w-full text-sm">
<tbody> <tbody>
<tr v-for="(v, k) of value"> <tr v-for="(v, k) of value">
<td class="text-capitalize whitespace-break-spaces w-1/5" style="min-width: 180px;">{{ String(k).replaceAll("_", " ") }}</td> <td
class="text-capitalize whitespace-break-spaces w-1/5"
style="min-width: 180px"
>
{{ String(k).replaceAll('_', ' ') }}
</td>
<td> <td>
<div <div
class="overflow-hidden w-auto whitespace-normal" class="overflow-hidden w-auto whitespace-normal"

View File

@ -39,56 +39,108 @@ const showDiscord = window.location.host.search('ping.pub') > -1;
<template> <template>
<div class="bg-gray-100 dark:bg-[#171d30]"> <div class="bg-gray-100 dark:bg-[#171d30]">
<!-- sidebar --> <!-- sidebar -->
<div class="w-64 fixed z-50 left-0 top-0 bottom-0 overflow-auto bg-base-100 border-r border-gray-100 dark:border-gray-700" <div
:class="{ block: sidebarShow, 'hidden xl:!block': !sidebarShow }"> class="w-64 fixed z-50 left-0 top-0 bottom-0 overflow-auto bg-base-100 border-r border-gray-100 dark:border-gray-700"
:class="{ block: sidebarShow, 'hidden xl:!block': !sidebarShow }"
>
<div class="flex items-center pl-4 py-4 mb-1"> <div class="flex items-center pl-4 py-4 mb-1">
<img class="w-10 h-10" src="../../assets/logo.svg" /> <img class="w-10 h-10" src="../../assets/logo.svg" />
<h1 class="flex-1 ml-3 text-2xl font-semibold dark:text-white"> <h1 class="flex-1 ml-3 text-2xl font-semibold dark:text-white">
Ping.pub Ping.pub
</h1> </h1>
<div class="pr-4 cursor-pointer xl:!hidden" @click="sidebarShow = false"> <div
class="pr-4 cursor-pointer xl:!hidden"
@click="sidebarShow = false"
>
<Icon icon="mdi-close" class="text-3xl" /> <Icon icon="mdi-close" class="text-3xl" />
</div> </div>
</div> </div>
<div v-for="(item, index) of blockchain.computedChainMenu" :key="index" class="px-2"> <div
<div v-if="item?.title && item?.children?.length" :tabindex="index" class="collapse" :class="{ v-for="(item, index) of blockchain.computedChainMenu"
:key="index"
class="px-2"
>
<div
v-if="item?.title && item?.children?.length"
:tabindex="index"
class="collapse"
:class="{
'collapse-arrow': item?.children?.length > 0, 'collapse-arrow': item?.children?.length > 0,
'collapse-open': index === 0 && sidebarOpen, 'collapse-open': index === 0 && sidebarOpen,
'collapse-close': index === 0 && !sidebarOpen, 'collapse-close': index === 0 && !sidebarOpen,
}"> }"
<input type="checkbox" class="cursor-pointer" @click="changeOpen(index)" /> >
<input
type="checkbox"
class="cursor-pointer !h-10 block"
@click="changeOpen(index)"
/>
<div <div
class="collapse-title px-4 flex items-center h-12 cursor-pointer hover:bg-gray-100 dark:hover:bg-[#373f59]"> class="collapse-title !py-0 px-4 flex items-center cursor-pointer hover:bg-gray-100 dark:hover:bg-[#373f59]"
<Icon v-if="item?.icon?.icon" :icon="item?.icon?.icon" class="text-xl mr-2" :class="{ >
<Icon
v-if="item?.icon?.icon"
:icon="item?.icon?.icon"
class="text-xl mr-2"
:class="{
'text-yellow-500': item?.title === 'Favorite', 'text-yellow-500': item?.title === 'Favorite',
'text-blue-500': item?.title !== 'Favorite', 'text-blue-500': item?.title !== 'Favorite',
}" /> }"
<img v-if="item?.icon?.image" :src="item?.icon?.image" class="w-6 h-6 rounded-full mr-3" /> />
<div class="text-sm capitalize flex-1 text-gray-700 dark:text-gray-200 whitespace-nowrap"> <img
v-if="item?.icon?.image"
:src="item?.icon?.image"
class="w-6 h-6 rounded-full mr-3"
/>
<div
class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200 whitespace-nowrap"
>
{{ item?.title }} {{ item?.title }}
</div> </div>
<div v-if="item?.badgeContent" class="mr-6 badge badge-sm" :class="item?.badgeClass"> <div
v-if="item?.badgeContent"
class="mr-6 badge badge-sm"
:class="item?.badgeClass"
>
{{ item?.badgeContent }} {{ item?.badgeContent }}
</div> </div>
</div> </div>
<div class="collapse-content"> <div class="collapse-content">
<div class="menu bg-base-100 w-full"> <div class="menu bg-base-100 w-full">
<RouterLink v-for="(el, key) of item?.children" @click="sidebarShow = false" :key="key" <RouterLink
v-for="(el, key) of item?.children"
@click="sidebarShow = false"
:key="key"
class="hover:bg-gray-100 dark:hover:bg-[#373f59] rounded cursor-pointer px-3 py-2 flex items-center" class="hover:bg-gray-100 dark:hover:bg-[#373f59] rounded cursor-pointer px-3 py-2 flex items-center"
:to="el?.to" :class="{ :to="el?.to"
:class="{
'!bg-primary': '!bg-primary':
$route.path === el?.to?.path && item?.title !== 'Favorite', $route.path === el?.to?.path && item?.title !== 'Favorite',
}"> }"
<Icon v-if="!el?.icon?.image" icon="mdi:chevron-right" class="mr-2 ml-3" :class="{ >
'text-white': $route.path === el?.to?.path && <Icon
item?.title !== 'Favorite', v-if="!el?.icon?.image"
}" /> icon="mdi:chevron-right"
<img v-if="el?.icon?.image" :src="el?.icon?.image" class="w-6 h-6 rounded-full mr-3 ml-4" /> class="mr-2 ml-3"
<div class="text-base capitalize text-gray-500 dark:text-gray-300" :class="{ :class="{
'text-white': 'text-white':
$route.path === el?.to?.path && $route.path === el?.to?.path &&
item?.title !== 'Favorite', item?.title !== 'Favorite',
}"> }"
/>
<img
v-if="el?.icon?.image"
:src="el?.icon?.image"
class="w-6 h-6 rounded-full mr-3 ml-4"
/>
<div
class="text-base capitalize text-gray-500 dark:text-gray-300"
:class="{
'text-white':
$route.path === el?.to?.path &&
item?.title !== 'Favorite',
}"
>
{{ item?.title === 'Favorite' ? el?.title : $t(el?.title) }} {{ item?.title === 'Favorite' ? el?.title : $t(el?.title) }}
</div> </div>
</RouterLink> </RouterLink>
@ -96,63 +148,116 @@ const showDiscord = window.location.host.search('ping.pub') > -1;
</div> </div>
</div> </div>
<RouterLink :to="item?.to" v-if="item?.title && !item?.children?.length && item?.to" <RouterLink
:to="item?.to"
v-if="item?.title && !item?.children?.length && item?.to"
@click="sidebarShow = false" @click="sidebarShow = false"
class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]"> class=" cursor-pointer rounded-lg px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]"
<Icon v-if="item?.icon?.icon" :icon="item?.icon?.icon" class="text-xl mr-2" :class="{ >
<Icon
v-if="item?.icon?.icon"
:icon="item?.icon?.icon"
class="text-xl mr-2"
:class="{
'text-yellow-500': item?.title === 'Favorite', 'text-yellow-500': item?.title === 'Favorite',
'text-blue-500': item?.title !== 'Favorite', 'text-blue-500': item?.title !== 'Favorite',
}" /> }"
<img v-if="item?.icon?.image" :src="item?.icon?.image" class="w-6 h-6 rounded-full mr-3" /> />
<div class="text-sm capitalize flex-1 text-gray-700 dark:text-gray-200 whitespace-nowrap"> <img
v-if="item?.icon?.image"
:src="item?.icon?.image"
class="w-6 h-6 rounded-full mr-3"
/>
<div
class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200 whitespace-nowrap"
>
{{ item?.title }} {{ item?.title }}
</div> </div>
<div v-if="item?.badgeContent" class=" badge badge-sm" :class="item?.badgeClass"> <div
v-if="item?.badgeContent"
class="badge badge-sm"
:class="item?.badgeClass"
>
{{ item?.badgeContent }} {{ item?.badgeContent }}
</div> </div>
</RouterLink> </RouterLink>
<div v-if="item?.heading" class="px-4 text-sm pt-3 text-gray-400 pb-2 uppercase"> <div
v-if="item?.heading"
class="px-4 text-sm text-gray-400 pb-2 uppercase"
>
{{ item?.heading }} {{ item?.heading }}
</div> </div>
</div> </div>
<div class="px-2"> <div class="px-2">
<div class="px-4 text-sm pt-4 text-gray-400 pb-2 uppercase"> <div class="px-4 text-sm pt-2 text-gray-400 pb-2 uppercase">
Sponsors Sponsors
</div> </div>
<a href="https://osmosis.zone" <a
class="collapse-title px-4 flex items-center py-2 rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"> href="https://osmosis.zone"
<img src="https://ping.pub/logos/osmosis.jpg" class="w-6 h-6 rounded-full mr-3" /> target="_blank"
<div class="text-sm capitalize flex-1 text-gray-600 dark:text-gray-200"> class="py-2 px-4 flex items-center cursor-pointer rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"
>
<img
src="https://ping.pub/logos/osmosis.jpg"
class="w-6 h-6 rounded-full mr-3"
/>
<div
class="text-sm capitalize flex-1 text-gray-600 dark:text-gray-200"
>
Osmosis Osmosis
</div> </div>
</a> </a>
<a href="https://becole.com" <a
class="collapse-title px-4 flex items-center py-1 rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"> href="https://becole.com"
<img src="https://becole.com/static/logo/logo_becole.png" class="w-6 h-6 rounded-full mr-3" /> target="_blank"
<div class="text-sm capitalize flex-1 text-gray-600 dark:text-gray-200"> class="py-2 px-4 flex items-center cursor-pointer rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"
>
<img
src="https://becole.com/static/logo/logo_becole.png"
class="w-6 h-6 rounded-full mr-3"
/>
<div
class="text-sm capitalize flex-1 text-gray-600 dark:text-gray-200"
>
Becole Becole
</div> </div>
</a> </a>
<div class="px-4 text-sm pt-4 text-gray-400 pb-2 uppercase">Links</div> <div class="px-4 text-sm pt-2 text-gray-400 pb-2 uppercase">Links</div>
<a href="https://twitter.com/ping_pub" <a
class="collapse-title px-4 flex items-center py-2 rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"> href="https://twitter.com/ping_pub"
target="_blank"
class="py-2 px-4 flex items-center cursor-pointer rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"
>
<Icon icon="mdi:twitter" class="text-xl mr-2" /> <Icon icon="mdi:twitter" class="text-xl mr-2" />
<div class="text-base capitalize flex-1 text-gray-600 dark:text-gray-200"> <div
class="text-base capitalize flex-1 text-gray-600 dark:text-gray-200"
>
Twitter Twitter
</div> </div>
</a> </a>
<a v-if="showDiscord" href="https://discord.com/invite/CmjYVSr6GW" <a
class="collapse-title px-4 flex items-center py-2 rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"> v-if="showDiscord"
href="https://discord.com/invite/CmjYVSr6GW"
target="_blank"
class="py-2 px-4 flex items-center rounded-lg cursor-pointer hover:bg-gray-100 dark:hover:bg-[#373f59]"
>
<Icon icon="mdi:discord" class="text-xl mr-2" /> <Icon icon="mdi:discord" class="text-xl mr-2" />
<div class="text-base capitalize flex-1 text-gray-600 dark:text-gray-200"> <div
class="text-base capitalize flex-1 text-gray-600 dark:text-gray-200"
>
Discord Discord
</div> </div>
</a> </a>
<a href="https://github.com/ping-pub/explorer/discussions" <a
class="collapse-title px-4 flex items-center py-2 rounded-lg hover:bg-gray-100 dark:hover:bg-[#373f59]"> href="https://github.com/ping-pub/explorer/discussions"
target="_blank"
class="py-2 px-4 flex items-center rounded-lg cursor-pointer hover:bg-gray-100 dark:hover:bg-[#373f59]"
>
<Icon icon="mdi:frequently-asked-questions" class="text-xl mr-2" /> <Icon icon="mdi:frequently-asked-questions" class="text-xl mr-2" />
<div class="text-base capitalize flex-1 text-gray-600 dark:text-gray-200"> <div
class="text-base capitalize flex-1 text-gray-600 dark:text-gray-200"
>
FAQ FAQ
</div> </div>
</a> </a>
@ -160,8 +265,13 @@ const showDiscord = window.location.host.search('ping.pub') > -1;
</div> </div>
<div class="xl:!ml-64 px-5 pt-4"> <div class="xl:!ml-64 px-5 pt-4">
<!-- header --> <!-- header -->
<div class="flex items-center py-3 bg-base-100 mb-4 rounded px-4 sticky top-0 z-10 shadow"> <div
<div class="text-2xl pr-3 cursor-pointer xl:!hidden" @click="sidebarShow = true"> class="flex items-center py-3 bg-base-100 mb-4 rounded px-4 sticky top-0 z-10 shadow"
>
<div
class="text-2xl pr-3 cursor-pointer xl:!hidden"
@click="sidebarShow = true"
>
<Icon icon="mdi-menu" /> <Icon icon="mdi-menu" />
</div> </div>

View File

@ -13,20 +13,20 @@ import { PageRequest } from '@/types';
const props = defineProps(['code_id', 'chain']); const props = defineProps(['code_id', 'chain']);
const pageRequest = ref(new PageRequest()) const pageRequest = ref(new PageRequest());
const response = ref({} as PaginabledContracts); const response = ref({} as PaginabledContracts);
const wasmStore = useWasmStore(); const wasmStore = useWasmStore();
function loadContract(pageNum: number) { function loadContract(pageNum: number) {
const pr = new PageRequest() const pr = new PageRequest();
pr.setPage(pageNum) pr.setPage(pageNum);
wasmStore.wasmClient.getWasmCodeContracts(props.code_id, pr).then((x) => { wasmStore.wasmClient.getWasmCodeContracts(props.code_id, pr).then((x) => {
response.value = x; response.value = x;
}); });
} }
loadContract(1) loadContract(1);
const dialog = useTxDialog() const dialog = useTxDialog();
const format = useFormatter(); const format = useFormatter();
const infoDialog = ref(false); const infoDialog = ref(false);
const info = ref({} as ContractInfo); const info = ref({} as ContractInfo);
@ -39,13 +39,15 @@ function showInfo(address: string) {
}); });
} }
function showState(address: string) { function showState(address: string) {
selected.value = address selected.value = address;
pageload(1) pageload(1);
} }
function pageload(p: number) { function pageload(p: number) {
pageRequest.value.setPage(p) pageRequest.value.setPage(p);
wasmStore.wasmClient.getWasmContractStates(selected.value, pageRequest.value).then((x) => { wasmStore.wasmClient
.getWasmContractStates(selected.value, pageRequest.value)
.then((x) => {
state.value = x; state.value = x;
}); });
} }
@ -115,22 +117,39 @@ const result = ref('');
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(v, index) in response.contracts" :key="index" class="hover"> <tr
v-for="(v, index) in response.contracts"
:key="index"
class="hover"
>
<td>{{ v }}</td> <td>{{ v }}</td>
<td> <td>
<label @click="showInfo(v)" for="modal-contract-detail" <label
class="btn btn-primary btn-xs text-xs mr-2">contract</label> @click="showInfo(v)"
for="modal-contract-detail"
class="btn btn-primary btn-xs text-xs mr-2"
>contract</label
>
<label class="btn btn-primary btn-xs text-xs mr-2" for="modal-contract-states" <label
@click="showState(v)"> class="btn btn-primary btn-xs text-xs mr-2"
for="modal-contract-states"
@click="showState(v)"
>
States States
</label> </label>
<label for="modal-contract-query" class="btn btn-primary btn-xs text-xs mr-2" <label
@click="showQuery(v)"> for="modal-contract-query"
class="btn btn-primary btn-xs text-xs mr-2"
@click="showQuery(v)"
>
Query Query
</label> </label>
<label for="wasm_execute_contract" class="btn btn-primary btn-xs text-xs" <label
@click="dialog.open('wasm_execute_contract', { contract: v })"> for="wasm_execute_contract"
class="btn btn-primary btn-xs text-xs"
@click="dialog.open('wasm_execute_contract', { contract: v })"
>
Execute Execute
</label> </label>
</td> </td>
@ -138,10 +157,21 @@ const result = ref('');
</tbody> </tbody>
</table> </table>
<div class="flex justify-between"> <div class="flex justify-between">
<PaginationBar :limit="50" :total="response.pagination?.total" :callback="loadContract" /> <PaginationBar
<label for="wasm_instantiate_contract" class="btn btn-primary my-5" :limit="50"
@click="dialog.open('wasm_instantiate_contract', { codeId: props.code_id })">Instantiate :total="response.pagination?.total"
Contract</label> :callback="loadContract"
/>
<label
for="wasm_instantiate_contract"
class="btn btn-primary my-5"
@click="
dialog.open('wasm_instantiate_contract', {
codeId: props.code_id,
})
"
>Instantiate Contract</label
>
</div> </div>
</div> </div>
</div> </div>
@ -152,8 +182,12 @@ const result = ref('');
<div> <div>
<div class="flex items-center justify-between px-3 pt-2"> <div class="flex items-center justify-between px-3 pt-2">
<div class="text-lg">Contract Detail</div> <div class="text-lg">Contract Detail</div>
<label @click="infoDialog = false" for="modal-contract-detail" <label
class="btn btn-sm btn-circle"></label> @click="infoDialog = false"
for="modal-contract-detail"
class="btn btn-sm btn-circle"
></label
>
</div> </div>
<div> <div>
<DynamicComponent :value="info" /> <DynamicComponent :value="info" />
@ -168,8 +202,12 @@ const result = ref('');
<div> <div>
<div class="flex items-center justify-between px-3 pt-2 mb-4"> <div class="flex items-center justify-between px-3 pt-2 mb-4">
<div class="text-lg">Contract States</div> <div class="text-lg">Contract States</div>
<label @click="infoDialog = false" for="modal-contract-states" <label
class="btn btn-sm btn-circle"></label> @click="infoDialog = false"
for="modal-contract-states"
class="btn btn-sm btn-circle"
></label
>
</div> </div>
<div class="overflow-auto"> <div class="overflow-auto">
<table class="table table-compact w-full text-sm"> <table class="table table-compact w-full text-sm">
@ -177,12 +215,19 @@ const result = ref('');
<td class="" :data-tip="format.hexToString(v.key)"> <td class="" :data-tip="format.hexToString(v.key)">
<span class="font-bold">{{ format.hexToString(v.key) }}</span> <span class="font-bold">{{ format.hexToString(v.key) }}</span>
</td> </td>
<td class="text-left w-3/4" :title="format.base64ToString(v.value)"> <td
class="text-left w-3/4"
:title="format.base64ToString(v.value)"
>
{{ format.base64ToString(v.value) }} {{ format.base64ToString(v.value) }}
</td> </td>
</tr> </tr>
</table> </table>
<PaginationBar :limit="pageRequest.limit" :total="state.pagination?.total" :callback="pageload" /> <PaginationBar
:limit="pageRequest.limit"
:total="state.pagination?.total"
:callback="pageload"
/>
</div> </div>
</div> </div>
</label> </label>
@ -194,17 +239,33 @@ const result = ref('');
<div> <div>
<div class="flex items-center justify-between px-3 pt-2 mb-4"> <div class="flex items-center justify-between px-3 pt-2 mb-4">
<div class="text-lg font-semibold">Query Contract</div> <div class="text-lg font-semibold">Query Contract</div>
<label @click="infoDialog = false" for="modal-contract-query" <label
class="btn btn-sm btn-circle"></label> @click="infoDialog = false"
for="modal-contract-query"
class="btn btn-sm btn-circle"
></label
>
</div> </div>
<div class="px-3"> <div class="px-3">
<div> <div>
<div class="grid grid-cols-2 gap-4 mb-4"> <div class="grid grid-cols-2 gap-4 mb-4">
<div class="form-control border rounded px-4" v-for="(item, index) of radioContent" <div
:key="index" :class="{ 'pt-2': index === 0 }"> class="form-control border rounded px-4"
<label class="label cursor-pointer justify-start" @click="selectedRadio = item?.value"> v-for="(item, index) of radioContent"
<input type="radio" name="radio-10" class="radio radio-sm radio-primary mr-4" :key="index"
:checked="item?.value === selectedRadio" style="border: 1px solid #d2d6dc" /> :class="{ 'pt-2': index === 0 }"
>
<label
class="label cursor-pointer justify-start"
@click="selectedRadio = item?.value"
>
<input
type="radio"
name="radio-10"
class="radio radio-sm radio-primary mr-4"
:checked="item?.value === selectedRadio"
style="border: 1px solid #d2d6dc"
/>
<div> <div>
<div class="text-base font-semibold"> <div class="text-base font-semibold">
{{ item?.title }} {{ item?.title }}
@ -219,7 +280,10 @@ const result = ref('');
<VTextarea v-model="result" label="Result" /> <VTextarea v-model="result" label="Result" />
</div> </div>
<div class="mt-4 mb-4"> <div class="mt-4 mb-4">
<button class="btn !btn-yes !border-yes px-4 text-white" @click="queryContract()"> <button
class="btn !btn-yes !border-yes px-4 text-white"
@click="queryContract()"
>
Query Contract Query Contract
</button> </button>
</div> </div>
@ -227,4 +291,5 @@ const result = ref('');
</div> </div>
</label> </label>
</label> </label>
</div></template> </div>
</template>

View File

@ -45,7 +45,7 @@ onMounted(() => {
</div> </div>
<!-- Node Information --> <!-- Node Information -->
<div class="bg-base-100 px-4 pt-3 pb-4ß rounded-sm mt-6"> <div class="bg-base-100 px-4 pt-3 pb-4 rounded-sm mt-6">
<div class="text-base mb-3 text-main">{{ store.nodeVersion?.title }}</div> <div class="text-base mb-3 text-main">{{ store.nodeVersion?.title }}</div>
<ArrayObjectElement :value="store.nodeVersion?.items" :thead="false" /> <ArrayObjectElement :value="store.nodeVersion?.items" :thead="false" />
</div> </div>

View File

@ -1,4 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Icon } from '@iconify/vue';
import { import {
useDashboard, useDashboard,
LoadingStatus, LoadingStatus,
@ -6,14 +7,11 @@ import {
} from '@/stores/useDashboard'; } from '@/stores/useDashboard';
import ChainSummary from '@/components/ChainSummary.vue'; import ChainSummary from '@/components/ChainSummary.vue';
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { useBlockchain } from '@/stores';
const dashboard = useDashboard(); const dashboard = useDashboard();
dashboard.$subscribe((mutation, state) => { dashboard.$subscribe((mutation, state) => {
localStorage.setItem('favorite', JSON.stringify(state.favorite)); localStorage.setItem('favorite', JSON.stringify(state.favorite));
// TODO: cause endless loop
// dashboard.loadingPrices()
}); });
const keywords = ref(''); const keywords = ref('');
const chains = computed(() => { const chains = computed(() => {
@ -28,7 +26,7 @@ const chains = computed(() => {
</script> </script>
<template> <template>
<div class=""> <div class="">
<div class="flex items-center justify-center mb-6 mt-10"> <div class="flex items-center justify-center mb-6 mt-14">
<div class="w-8 md:!w-16 rounded-full mr-3"> <div class="w-8 md:!w-16 rounded-full mr-3">
<img src="/logo.svg" /> <img src="/logo.svg" />
</div> </div>
@ -52,17 +50,11 @@ const chains = computed(() => {
<progress class="progress progress-info w-80 h-1"></progress> <progress class="progress progress-info w-80 h-1"></progress>
</div> </div>
<VTextField <div class="flex items-center rounded-full bg-base-100 border border-gray-200 dark:border-gray-700 mt-10">
v-model="keywords" <Icon icon="mdi:magnify" class="text-2xl text-gray-400 ml-3"/>
variant="underlined" <input :placeholder="$t('index.search_placeholder')" class="px-4 h-10 bg-transparent flex-1 outline-none text-base" v-model="keywords" />
:placeholder="$t('index.search_placeholder')" <div class="px-4 text-base">{{ chains.length }}/{{ dashboard.length }}</div>
style="max-width: 300px" </div>
app
>
<template #append-inner>
{{ chains.length }}/{{ dashboard.length }}
</template>
</VTextField>
<div <div
class="grid grid-cols-2 gap-4 mt-6 md:!grid-cols-3 lg:!grid-cols-4 2xl:!grid-cols-5" class="grid grid-cols-2 gap-4 mt-6 md:!grid-cols-3 lg:!grid-cols-4 2xl:!grid-cols-5"

View File

@ -11,14 +11,7 @@ module.exports = {
main: 'var(--text-main)', main: 'var(--text-main)',
secondary: 'var(--text-secondary)', secondary: 'var(--text-secondary)',
active: 'var(--bg-active)', active: 'var(--bg-active)',
}, }
borderRadius: {
none: '0',
xs: '.125rem',
sm: '.25rem',
DEFAULT: '.5rem',
lg: '.75rem',
},
}, },
}, },
plugins: [require('daisyui')], plugins: [require('daisyui')],