diff --git a/packages/dashboard/auto-imports.d.ts b/packages/dashboard/auto-imports.d.ts index 3780698a..10eab88d 100644 --- a/packages/dashboard/auto-imports.d.ts +++ b/packages/dashboard/auto-imports.d.ts @@ -182,6 +182,7 @@ declare global { const useFullscreen: typeof import('@vueuse/core')['useFullscreen'] const useGamepad: typeof import('@vueuse/core')['useGamepad'] const useGeolocation: typeof import('@vueuse/core')['useGeolocation'] + const useI18n: typeof import('vue-i18n')['useI18n'] const useIdle: typeof import('@vueuse/core')['useIdle'] const useImage: typeof import('@vueuse/core')['useImage'] const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll'] @@ -483,6 +484,7 @@ declare module 'vue' { readonly useFullscreen: UnwrapRef readonly useGamepad: UnwrapRef readonly useGeolocation: UnwrapRef + readonly useI18n: UnwrapRef readonly useIdle: UnwrapRef readonly useImage: UnwrapRef readonly useInfiniteScroll: UnwrapRef diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index 007a405a..c2439259 100644 --- a/packages/dashboard/package.json +++ b/packages/dashboard/package.json @@ -15,15 +15,18 @@ "@casl/vue": "^2.2.1", "@floating-ui/dom": "^1.2.0", "@iconify/vue": "^4.1.0", + "@intlify/unplugin-vue-i18n": "^0.8.2", "@ping-pub/chain-registry-client": "^0.0.25", "@vitejs/plugin-vue-jsx": "^3.0.0", "@vueuse/core": "^9.12.0", "@vueuse/math": "^9.12.0", + "axios": "^1.3.2", "cross-fetch": "^3.1.5", "pinia": "^2.0.28", "vite-plugin-vue-layouts": "^0.7.0", "vite-plugin-vuetify": "^1.0.2", "vue": "^3.2.45", + "vue-i18n": "^9.2.2", "vue-router": "^4.1.6", "vue3-perfect-scrollbar": "^1.6.1", "vuetify": "3.0.6", diff --git a/packages/dashboard/src/layouts/components/ChainProfile.vue b/packages/dashboard/src/layouts/components/ChainProfile.vue new file mode 100644 index 00000000..7299d4dd --- /dev/null +++ b/packages/dashboard/src/layouts/components/ChainProfile.vue @@ -0,0 +1,55 @@ + + + diff --git a/packages/dashboard/src/layouts/components/DefaultLayout.vue b/packages/dashboard/src/layouts/components/DefaultLayout.vue index 5f41012f..80fbdc54 100644 --- a/packages/dashboard/src/layouts/components/DefaultLayout.vue +++ b/packages/dashboard/src/layouts/components/DefaultLayout.vue @@ -4,13 +4,15 @@ import { useThemeConfig } from '@/plugins/vuetify/@core/composable/useThemeConfi // Components import Footer from '@/layouts/components/Footer.vue' import NavbarThemeSwitcher from '@/layouts/components/NavbarThemeSwitcher.vue' -import UserProfile from '@/layouts/components/UserProfile.vue' +import UserProfile from '@/layouts/components/ChainProfile.vue' -import type { VerticalNavItems } from '@/@layouts/types' import { useDashboard } from '@/stores/useDashboard' // @layouts plugin import { VerticalNavLayout } from '@layouts' +import NavBarI18n from './NavBarI18n.vue' +import NavSearchBar from './NavSearchBar.vue' +import NavBarNotifications from './NavBarNotifications.vue' const { appRouteTransition, isLessThanOverlayNavBreakpoint, isVerticalNavCollapsed } = useThemeConfig() const { width: windowWidth } = useWindowSize() @@ -38,11 +40,13 @@ dashboard.initial() - + - - + + + + diff --git a/packages/dashboard/src/layouts/components/NavBarI18n.vue b/packages/dashboard/src/layouts/components/NavBarI18n.vue index 2afdc854..684f6192 100644 --- a/packages/dashboard/src/layouts/components/NavBarI18n.vue +++ b/packages/dashboard/src/layouts/components/NavBarI18n.vue @@ -11,8 +11,8 @@ const i18nCompLanguages: I18nLanguage[] = [ i18nLang: 'en', }, { - label: 'French', - i18nLang: 'fr', + label: 'δΈ­ζ–‡', + i18nLang: 'cn', }, { label: 'Arabic', @@ -22,6 +22,7 @@ const i18nCompLanguages: I18nLanguage[] = [ const handleLangChange = (lang: string) => { isAppRtl.value = lang === 'ar' + localStorage.setItem('lang', lang) } diff --git a/packages/dashboard/src/layouts/components/NavSearchBar.vue b/packages/dashboard/src/layouts/components/NavSearchBar.vue index f501f4b7..a9c29318 100644 --- a/packages/dashboard/src/layouts/components/NavSearchBar.vue +++ b/packages/dashboard/src/layouts/components/NavSearchBar.vue @@ -1,6 +1,6 @@ - - diff --git a/packages/dashboard/src/layouts/navigation/index.ts b/packages/dashboard/src/layouts/navigation/index.ts deleted file mode 100644 index 5f2f605e..00000000 --- a/packages/dashboard/src/layouts/navigation/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { VerticalNavItems } from '@/@layouts/types' - -export default [ - { - title: 'Home', - to: { name: 'index' }, - icon: { icon: 'mdi-home-outline' }, - }, - { - title: 'Second page', - to: { name: 'second-page' }, - icon: { icon: 'mdi-file-document-outline' }, - }, - { - title: 'Second2 page', - to: { name: 'second-page' }, - icon: { icon: 'mdi-file-document-outline' }, - }, -] as VerticalNavItems diff --git a/packages/dashboard/src/main.ts b/packages/dashboard/src/main.ts index 8292a3ab..307cfa1e 100644 --- a/packages/dashboard/src/main.ts +++ b/packages/dashboard/src/main.ts @@ -3,6 +3,7 @@ import "@/plugins/vuetify/@iconify/icons-bundle"; import App from "@/App.vue"; import layoutsPlugin from "@/plugins/vuetify/layouts"; import vuetify from "@/plugins/vuetify"; +import i18n from "@/plugins/i18n"; import { loadFonts } from "@/plugins/vuetify/webfontloader"; import "@/plugins/vuetify/@core/scss/template/index.scss"; import "@/plugins/vuetify/styles/styles.scss"; @@ -18,6 +19,7 @@ loadFonts(); const app = createApp(App); // Use plugins +app.use(i18n) app.use(vuetify); app.use(createPinia()); app.use(layoutsPlugin); diff --git a/packages/dashboard/src/pages/index.vue b/packages/dashboard/src/pages/index.vue index 0febe947..d38a34cd 100644 --- a/packages/dashboard/src/pages/index.vue +++ b/packages/dashboard/src/pages/index.vue @@ -1,31 +1,47 @@