improve UI for mobile

This commit is contained in:
liangping 2023-05-22 14:52:47 +08:00
parent e6eb61021d
commit 1cfc49e9a9
4 changed files with 51 additions and 43 deletions

View File

@ -15,40 +15,49 @@ chainStore.initial();
></div> ></div>
</div> </div>
<div <div
class="dropdown-content menu shadow bg-base-100 rounded-box max-h-[300px] overflow-auto" class="dropdown-content w-80 menu shadow bg-base-200 rounded-box max-h-[300px] overflow-auto"
> >
<div> <!-- rest -->
<!-- rest --> <div class="px-4 py-2 text-sm text-gray-400">
<div Information
class="px-4 py-2 text-sm text-gray-400" </div>
v-if="chainStore.current?.endpoints?.rest" <div class="w-full hover:bg-gray-100 dark:bg-[#384059]">
> <div class="py-2 px-4">
Rest Endpoint Chain Id: {{ baseStore.latest.block?.header.chain_id }}
</div> </div>
<div tabindex="0"> <div class="py-2 px-4">
<div Height: {{ baseStore.latest.block?.header.height }}
v-for="(item, index) in chainStore.current?.endpoints?.rest" </div>
@click="chainStore.setRestEndpoint(item)" </div>
class="px-4 py-2 hover:bg-gray-100 dark:bg-[#384059] cursor-pointer" <!-- rest -->
:key="index" <div
> class="px-4 py-2 text-sm text-gray-400"
<div class="flex flex-col items-start"> v-if="chainStore.current?.endpoints?.rest"
<div class="flex items-center justify-between w-full"> >
<div class="text-gray-500 dark:text-gray-200 capitalize"> Rest Endpoint
{{ item.provider }} </div>
</div> <div
v-for="(item, index) in chainStore.current?.endpoints?.rest"
<span @click="chainStore.setRestEndpoint(item)"
v-if="item.address === chainStore.endpoint?.address" class="px-4 py-2 w-full hover:bg-gray-100 dark:bg-[#384059] cursor-pointer"
class="bg-yes inline-block h-2 w-2 rounded-full" :key="index"
/> >
</div> <div class="flex flex-col items-start">
<div class="text-gray-400 text-xs whitespace-nowrap"> <div class="flex items-center justify-between w-full">
{{ item.address }} <div class="text-gray-500 dark:text-gray-200 capitalize">
</div> {{ item.provider }}
</div> </div>
<span
v-if="item.address === chainStore.endpoint?.address"
class="bg-yes inline-block h-2 w-2 rounded-full"
/>
</div>
<div class="text-gray-400 text-xs whitespace-nowrap">
{{ item.address }}
</div> </div>
</div> </div>
</div>
<!-- grpc --> <!-- grpc -->
<div <div
@ -74,13 +83,12 @@ chainStore.initial();
</div> </div>
</li> </li>
</ul> </ul>
</div>
</div> </div>
</div> </div>
<div class="flex-1 w-0"> <div class="flex-1 w-0">
<Transition name="fade" mode="out-in" appear> <Transition name="fade" mode="out-in" appear>
<div :key="baseStore.latest?.block?.header?.height || chainStore.chainName || ''" <div :key="baseStore.latest?.block?.header?.height || chainStore.chainName || ''"
class="capitalize whitespace-nowrap text-base font-semibold text-gray-600 dark:text-gray-200" class="capitalize whitespace-nowrap text-base font-semibold text-gray-600 dark:text-gray-200 hidden md:!block"
> >
#{{ #{{
baseStore.latest?.block?.header?.height || chainStore.chainName || '' baseStore.latest?.block?.header?.height || chainStore.chainName || ''
@ -88,7 +96,7 @@ chainStore.initial();
</div> </div>
</Transition> </Transition>
<div <div
class="text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap hidden lg:!block" class="text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap hidden md:!block"
> >
{{ chainStore.connErr || chainStore.endpoint.address }} {{ chainStore.connErr || chainStore.endpoint.address }}
</div> </div>

View File

@ -6,7 +6,7 @@ import { useThemeConfig } from '@/plugins/vuetify/@core/composable/useThemeConfi
// Components // Components
import newFooter from '@/layouts/components/NavFooter.vue'; import newFooter from '@/layouts/components/NavFooter.vue';
import NavbarThemeSwitcher from '@/layouts/components/NavbarThemeSwitcher.vue'; import NavbarThemeSwitcher from '@/layouts/components/NavbarThemeSwitcher.vue';
import UserProfile from '@/layouts/components/ChainProfile.vue'; import ChainProfile from '@/layouts/components/ChainProfile.vue';
import { useDashboard } from '@/stores/useDashboard'; import { useDashboard } from '@/stores/useDashboard';
@ -229,7 +229,7 @@ const showDiscord = window.location.host.search("ping.pub") > -1
<Icon icon="mdi-menu" /> <Icon icon="mdi-menu" />
</div> </div>
<UserProfile /> <ChainProfile />
<div class="flex-1 w-0"></div> <div class="flex-1 w-0"></div>

View File

@ -103,8 +103,8 @@ const color = computed(() => {
v-if="coinInfo && coinInfo.name" v-if="coinInfo && coinInfo.name"
class="bg-base-100 rounded shadow mb-4" class="bg-base-100 rounded shadow mb-4"
> >
<div class="flex p-4"> <div class="grid grid-cols-2 md:grid-cols-3 p-4">
<div class=""> <div class="col-span-2 md:col-span-1">
<div class="text-xl font-semibold text-main"> <div class="text-xl font-semibold text-main">
{{ coinInfo.name }} (<span class="uppercase">{{ {{ coinInfo.name }} (<span class="uppercase">{{
coinInfo.symbol coinInfo.symbol
@ -119,7 +119,7 @@ const color = computed(() => {
</div> </div>
</div> </div>
<div class="mt-4 flex items-center"> <div class="my-4 flex flex-wrap items-center">
<a <a
v-for="(item, index) of comLinks" v-for="(item, index) of comLinks"
:key="index" :key="index"
@ -133,7 +133,7 @@ const color = computed(() => {
<div> <div>
<div <div
class="dropdown dropdown-hover w-full md:!w-[400px] mt-[16px] md:!mt-[36px]" class="dropdown dropdown-hover w-full"
> >
<label> <label>
<div <div
@ -166,7 +166,7 @@ const color = computed(() => {
</label> </label>
<div class="dropdown-content pt-1"> <div class="dropdown-content pt-1">
<div <div
class="h-64 overflow-auto w-full md:!w-[400px] shadow rounded" class="h-64 overflow-auto w-full shadow rounded"
> >
<ul class="menu w-full bg-gray-100 rounded dark:bg-[#384059]"> <ul class="menu w-full bg-gray-100 rounded dark:bg-[#384059]">
<li <li
@ -200,7 +200,7 @@ const color = computed(() => {
<a <a
:color="store.trustColor" :color="store.trustColor"
class="mt-5 !text-white btn !bg-yes !border-yes w-full md:!w-[400px] flex items-center" class="my-5 !text-white btn !bg-yes !border-yes w-full"
:href="ticker.trade_url" :href="ticker.trade_url"
target="_blank" target="_blank"
> >
@ -209,7 +209,7 @@ const color = computed(() => {
</div> </div>
</div> </div>
<div class="flex-1 hidden md:!block"> <div class="col-span-2">
<PriceMarketChart /> <PriceMarketChart />
</div> </div>
</div> </div>
@ -243,7 +243,7 @@ const color = computed(() => {
<div class="px-4 pb-4"> <div class="px-4 pb-4">
<ProposalListItem :proposals="store?.proposals" /> <ProposalListItem :proposals="store?.proposals" />
</div> </div>
<div class="pl-4 pb-8 py-4" v-if="store.proposals?.length === 0"> <div class="pb-8 text-center" v-if="store.proposals?.proposals?.length === 0">
No active proposals No active proposals
</div> </div>
</div> </div>

View File

@ -152,7 +152,7 @@ function changeTab(v: string) {
</div> </div>
</div> </div>
<div :class="tab === '3'?'':'hidden'"> <div :class="tab === '3'?'':'hidden'" class=" overflow-hidden">
<table class="table table-compact w-full mt-5"> <table class="table table-compact w-full mt-5">
<thead class=" capitalize"> <thead class=" capitalize">
<tr> <tr>