forked from LaconicNetwork/cosmos-explorer
fix all build checks
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, resolveComponent, h } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const routerView = resolveComponent('router-view');
|
||||
|
||||
@@ -13,6 +13,7 @@ import { useBlockchain } from '@/stores';
|
||||
|
||||
import NavBarI18n from './NavBarI18n.vue';
|
||||
import NavBarWallet from './NavBarWallet.vue';
|
||||
import type { NavGroup, NavLink, NavSectionTitle } from '../types';
|
||||
|
||||
const dashboard = useDashboard();
|
||||
dashboard.initial();
|
||||
@@ -35,6 +36,16 @@ const changeOpen = (index: Number) => {
|
||||
}
|
||||
};
|
||||
const showDiscord = window.location.host.search('ping.pub') > -1;
|
||||
|
||||
function isNavGroup(nav: NavGroup | NavLink | NavSectionTitle | any): nav is NavGroup {
|
||||
return (<NavGroup>nav).children !== undefined;
|
||||
}
|
||||
function isNavLink(nav: NavGroup | NavLink | NavSectionTitle | any): nav is NavLink {
|
||||
return (<NavLink>nav).to !== undefined;
|
||||
}
|
||||
function isNavTitle(nav: NavGroup | NavLink | NavSectionTitle | any): nav is NavSectionTitle {
|
||||
return (<NavSectionTitle>nav).heading !== undefined;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -62,7 +73,7 @@ const showDiscord = window.location.host.search('ping.pub') > -1;
|
||||
class="px-2"
|
||||
>
|
||||
<div
|
||||
v-if="item?.title && item?.children?.length"
|
||||
v-if="isNavGroup(item)"
|
||||
:tabindex="index"
|
||||
class="collapse"
|
||||
:class="{
|
||||
@@ -151,7 +162,7 @@ const showDiscord = window.location.host.search('ping.pub') > -1;
|
||||
|
||||
<RouterLink
|
||||
:to="item?.to"
|
||||
v-if="item?.title && !item?.children?.length && item?.to"
|
||||
v-if="isNavGroup(item)"
|
||||
@click="sidebarShow = false"
|
||||
class="cursor-pointer rounded-lg px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]"
|
||||
>
|
||||
@@ -183,7 +194,7 @@ const showDiscord = window.location.host.search('ping.pub') > -1;
|
||||
</div>
|
||||
</RouterLink>
|
||||
<div
|
||||
v-if="item?.heading"
|
||||
v-if="isNavTitle(item)"
|
||||
class="px-4 text-sm text-gray-400 pb-2 uppercase"
|
||||
>
|
||||
{{ item?.heading }}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { Icon } from '@iconify/vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const i18nLangs: Array<{ label: string; i18nLang: string }> = [
|
||||
{
|
||||
label: 'English',
|
||||
@@ -13,7 +15,7 @@ const i18nLangs: Array<{ label: string; i18nLang: string }> = [
|
||||
];
|
||||
|
||||
let locale = ref(useI18n({ useScope: 'global' }).locale);
|
||||
watch(locale, (val: string) => {
|
||||
watch(locale, (val) => {
|
||||
document.documentElement.setAttribute('lang', val as string);
|
||||
});
|
||||
|
||||
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
// 👉 Vertical nav section title
|
||||
export interface NavSectionTitle extends Partial<AclProperties> {
|
||||
heading: string
|
||||
}
|
||||
|
||||
// 👉 Vertical nav link
|
||||
declare type ATagTargetAttrValues = '_blank' | '_self' | '_parent' | '_top' | 'framename'
|
||||
declare type ATagRelAttrValues =
|
||||
| 'alternate'
|
||||
| 'author'
|
||||
| 'bookmark'
|
||||
| 'external'
|
||||
| 'help'
|
||||
| 'license'
|
||||
| 'next'
|
||||
| 'nofollow'
|
||||
| 'noopener'
|
||||
| 'noreferrer'
|
||||
| 'prev'
|
||||
| 'search'
|
||||
| 'tag'
|
||||
|
||||
export interface NavLinkProps {
|
||||
to?: RouteLocationRaw | string | null
|
||||
href?: string
|
||||
target?: ATagTargetAttrValues
|
||||
rel?: ATagRelAttrValues
|
||||
i18n?: boolean
|
||||
}
|
||||
|
||||
export interface Icon {
|
||||
icon?: string,
|
||||
image?: string,
|
||||
size: string,
|
||||
}
|
||||
|
||||
export interface NavLink extends NavLinkProps {
|
||||
title: string
|
||||
icon?: Icon
|
||||
badgeContent?: string
|
||||
badgeClass?: string
|
||||
disable?: boolean
|
||||
order?: number
|
||||
}
|
||||
|
||||
// 👉 Vertical nav group
|
||||
export interface NavGroup extends NavLinkProps {
|
||||
title: string
|
||||
icon?: Icon
|
||||
badgeContent?: string
|
||||
badgeClass?: string
|
||||
children: (NavLink | NavGroup)[]
|
||||
disable?: boolean
|
||||
order?: number
|
||||
}
|
||||
|
||||
export declare type VerticalNavItems = (NavLink | NavGroup | NavSectionTitle)[]
|
||||
export declare type HorizontalNavItems = (NavLink | NavGroup)[]
|
||||
Reference in New Issue
Block a user