fix responsive for columne

This commit is contained in:
Pham Tu 2024-01-24 10:53:44 +07:00
parent 7377f55854
commit 727cc6aeb1
No known key found for this signature in database
GPG Key ID: 7460FD99133ADA1C
11 changed files with 113 additions and 76 deletions

View File

@ -7,40 +7,25 @@ const props = defineProps({
css: { type: String },
});
const s = ref(0)
const s = ref(0);
</script>
<template>
<Countdown
v-if="time"
:time="time > 0 ? time : 0"
v-slot="{ days, hours, minutes, seconds }"
class="countdown-container justify-items-center "
class="countdown-container justify-items-center"
>
<span class="text-primary font-bold " :class="css">{{ days }}</span> days
<span class="text-primary font-bold" :class="css">{{ hours }}</span> hours
<span class="text-primary font-bold" :class="css">{{ minutes }}</span> minutes
<span class="text-primary font-bold w-40" :class="css">
<Transition name="slide-up">
<span v-if="seconds % 2 === 0" class="countdown">{{ seconds }}</span>
<span v-else="seconds % 2 === 1" class="countdown">{{ seconds }}</span>
</Transition>
</span>
<span class="ml-10">seconds</span>
<span class="text-primary font-bold" :class="css">{{ days }}</span> days
<span class="text-primary font-bold" :class="css">{{ hours }}</span> hours
<span class="text-primary font-bold" :class="css">{{ minutes }}</span>
minutes
<span class="text-primary font-bold w-40" :class="css">
<Transition name="slide-up">
<span v-if="seconds % 2 === 0" class="countdown">{{ seconds }}</span>
<span v-else="seconds % 2 === 1" class="countdown">{{ seconds }}</span>
</Transition>
</span>
<span class="ml-10">seconds</span>
</Countdown>
</template>
<style>
.countdown-container {
display: inline-flexbox;
position: relative;
}
.countdown {
position: absolute;
width: 45%;
text-align: right;
float: right;
}
</style>

View File

@ -38,5 +38,3 @@ const bars = computed(() => {
</div>
</div>
</template>
<style></style>

View File

@ -0,0 +1,10 @@
<script lang="ts" setup>
import { useFormatter } from '@/stores';
const props = defineProps(['value']);
const format = useFormatter();
</script>
<template>
<div class="overflow-auto">
{{ format.toLocaleDate(value) }}
</div>
</template>

View File

@ -51,11 +51,11 @@ function getClass(value: string) {
{{ text }}
</span>
</div>
<div class="btn-group mt-4" role="group">
<div class="btn-group mt-4 inline-block" role="group">
<button
type="button"
v-bind:class="getClass('utf8')"
class="btn btn-sm"
class="btn btn-xs"
@click="change('utf8')"
>
Utf8
@ -63,7 +63,7 @@ function getClass(value: string) {
<button
type="button"
v-bind:class="getClass('base64')"
class="btn btn-sm"
class="btn btn-xs"
@click="change('base64')"
>
Base64
@ -71,7 +71,7 @@ function getClass(value: string) {
<button
type="button"
v-bind:class="getClass('hex')"
class="btn btn-sm"
class="btn btn-xs"
@click="change('hex')"
>
Hex

View File

@ -11,6 +11,7 @@ import ArrayElement from './ArrayElement.vue';
import UInt8Array from './UInt8Array.vue';
import NumberElement from './NumberElement.vue';
import TokenElement from './TokenElement.vue';
import TimestampElement from './TimestampElement.vue';
import ObjectHorizontalElement from './ObjectHorizontalElement.vue';
import Long from 'long';
@ -44,6 +45,10 @@ function selectObject(v: Object, direct?: string) {
Object.keys(v).includes('denom'): {
return TokenElement;
}
case v && Object.keys(v).includes('seconds'):
case v instanceof Date: {
return TimestampElement;
}
case direct === 'horizontal':
return ObjectHorizontalElement;
default:

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { defineComponent, resolveComponent, h } from 'vue'
import { defineComponent, resolveComponent, h } from 'vue';
export default defineComponent({
setup() {
@ -10,9 +10,3 @@ export default defineComponent({
},
});
</script>
<style>
.layout-wrapper.layout-blank {
flex-direction: column;
}
</style>

View File

@ -36,35 +36,60 @@ const tipMsg = computed(() => {
<template>
<div class="dropdown dropdown-hover dropdown-end">
<label tabindex="0" class="btn btn-sm btn-primary m-1 lowercase truncate !inline-flex text-xs md:!text-sm">
<label
tabindex="0"
class="btn btn-sm btn-primary m-1 lowercase truncate !inline-flex text-xs md:!text-sm"
>
<Icon icon="mdi:wallet" />
<span class="ml-1 hidden md:block">
{{ walletStore.shortAddress || 'Wallet' }}</span>
{{ walletStore.shortAddress || 'Wallet' }}</span
>
</label>
<div tabindex="0" class="dropdown-content menu shadow p-2 bg-base-100 rounded w-52 md:!w-64 overflow-auto">
<label v-if="!walletStore?.currentAddress" for="PingConnectWallet" class="btn btn-sm btn-primary">
<div
tabindex="0"
class="dropdown-content menu shadow p-2 bg-base-100 rounded w-52 md:!w-64 overflow-auto"
>
<label
v-if="!walletStore?.currentAddress"
for="PingConnectWallet"
class="btn btn-sm btn-primary"
>
<Icon icon="mdi:wallet" /><span class="ml-1 block">Connect Wallet</span>
</label>
<div class="px-2 mb-1 text-gray-500 dark:text-gray-400 font-semibold">
{{ walletStore.connectedWallet?.wallet }}
</div>
<div>
<a v-if="walletStore.currentAddress"
<a
v-if="walletStore.currentAddress"
class="block py-2 px-2 hover:bg-gray-100 dark:hover:bg-[#353f5a] rounded cursor-pointer"
style="overflow-wrap: anywhere" @click="copyAdress(walletStore.currentAddress)">
style="overflow-wrap: anywhere"
@click="copyAdress(walletStore.currentAddress)"
>
{{ walletStore.currentAddress }}
</a>
<div class="divider mt-1 mb-1"></div>
<RouterLink to="/wallet/accounts">
<div class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer">Accounts</div>
<div
class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer"
>
Accounts
</div>
</RouterLink>
<RouterLink to="/wallet/portfolio">
<div class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer">Portfolio</div>
<div
class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer"
>
Portfolio
</div>
</RouterLink>
<div v-if="walletStore.currentAddress" class="divider mt-1 mb-1"></div>
<a v-if="walletStore.currentAddress"
<a
v-if="walletStore.currentAddress"
class="block py-2 px-2 hover:bg-gray-100 dark:hover:bg-[#353f5a] rounded cursor-pointer"
@click="walletStore.disconnect()">Disconnect</a>
@click="walletStore.disconnect()"
>Disconnect</a
>
</div>
</div>
<div class="toast" v-show="showCopyToast === 1">
@ -83,15 +108,12 @@ const tipMsg = computed(() => {
</div>
</div>
<Teleport to="body">
<ping-connect-wallet :chain-id="baseStore.currentChainId" :hd-path="chainStore.defaultHDPath"
:addr-prefix="chainStore.current?.bech32Prefix || 'cosmos'" @connect="walletStateChange"
@keplr-config="walletStore.suggestChain()" />
<ping-connect-wallet
:chain-id="baseStore.currentChainId"
:hd-path="chainStore.defaultHDPath"
:addr-prefix="chainStore.current?.bech32Prefix || 'cosmos'"
@connect="walletStateChange"
@keplr-config="walletStore.suggestChain()"
/>
</Teleport>
</template>
<style>
.ping-connect-btn,
.ping-connect-dropdown {
display: none !important;
}
</style>

View File

@ -25,8 +25,7 @@ const isFutureBlock = computed({
const latest = store.latest?.block?.header.height
const isFuture = latest ? target.value > Number(latest) : true
if (!isFuture && !current.value.blockId) store.fetchBlock(target.value).then(x => {
current.value = x;
console.log('fetchBlock',x.block.txs);
current.value = x;
})
return isFuture
},
@ -59,8 +58,7 @@ function updateTarget() {
onBeforeRouteUpdate(async (to, from, next) => {
if (from.path !== to.path) {
store.fetchBlock(String(to.params.height)).then(x => {
current.value = x;
console.log('fetchBlock',x.block.txs);
current.value = x;
});
next();
}

View File

@ -578,10 +578,3 @@ loadAvatars();
}
}
</route>
<style>
.staking-table.table :where(th, td) {
padding: 8px 5px;
background: transparent;
}
</style>

View File

@ -42,10 +42,6 @@ export const useBaseStore = defineStore('baseStore', {
const diff = dayjs(this.latest.block?.header?.time.toString()).diff(
this.earlest.block?.header?.time.toString()
);
console.log(
JSON.stringify(this.earlest),
JSON.stringify(this.latest)
);
const blocks =
Number(this.latest.block.header.height) -
Number(this.earlest.block.header.height);

View File

@ -34,6 +34,10 @@ html[data-theme='dark'] {
--bg-active: #242b40;
}
table td {
min-width: 100px!important;
}
.table th:first-child {
position: relative;
z-index: 2;
@ -58,6 +62,38 @@ html[data-theme='dark'] {
word-break: break-word;
}
.ping-connect-btn,
.ping-connect-dropdown {
display: none !important;
}
.layout-wrapper.layout-blank {
flex-direction: column;
}
.countdown-container {
display: inline-flexbox;
position: relative;
}
.countdown {
position: absolute;
width: 45%;
text-align: right;
float: right;
}
.validatore-table.table :where(th, td) {
padding: 0.6rem 1rem;
font-size: 14px;
}
.staking-table.table :where(th, td) {
padding: 8px 5px;
background: transparent;
}
.text-break {
word-break: break-word;
}