From 652588abede68e3a28c2cf4cbe90468d9e0f9df9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 24 Oct 2021 14:50:00 +0900 Subject: [PATCH] refactor client --- locales/ja-JP.yml | 1 + src/client/init.ts | 2 +- src/client/menu.ts | 14 ++++++++++---- .../ui/{default.header.vue => classic.header.vue} | 0 .../ui/{default.side.vue => classic.side.vue} | 0 .../{default.sidebar.vue => classic.sidebar.vue} | 0 src/client/ui/{default.vue => classic.vue} | 6 +++--- .../{default.widgets.vue => classic.widgets.vue} | 0 src/client/ui/universal.vue | 2 +- 9 files changed, 16 insertions(+), 9 deletions(-) rename src/client/ui/{default.header.vue => classic.header.vue} (100%) rename src/client/ui/{default.side.vue => classic.side.vue} (100%) rename src/client/ui/{default.sidebar.vue => classic.sidebar.vue} (100%) rename src/client/ui/{default.vue => classic.vue} (98%) rename src/client/ui/{default.widgets.vue => classic.widgets.vue} (100%) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5402a05e4..2874feea0 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -799,6 +799,7 @@ controllPanel: "コントロールパネル" manageAccounts: "アカウントを管理" makeReactionsPublic: "リアクション一覧を公開する" makeReactionsPublicDescription: "あなたがしたリアクション一覧を誰でも見れるようにします。" +classic: "クラシック" _signup: almostThere: "ほとんど完了です" diff --git a/src/client/init.ts b/src/client/init.ts index 00dcc6024..123d4020e 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -166,7 +166,7 @@ const app = createApp(await ( ui === 'deck' ? import('@client/ui/deck.vue') : ui === 'desktop' ? import('@client/ui/desktop.vue') : ui === 'chat' ? import('@client/ui/chat/index.vue') : - ui === 'default' ? import('@client/ui/default.vue') : + ui === 'classic' ? import('@client/ui/classic.vue') : import('@client/ui/universal.vue') ).then(x => x.default)); diff --git a/src/client/menu.ts b/src/client/menu.ts index 0a9e2b547..c884772a4 100644 --- a/src/client/menu.ts +++ b/src/client/menu.ts @@ -2,6 +2,7 @@ import { computed, ref } from 'vue'; import { search } from '@client/scripts/search'; import * as os from '@client/os'; import { i18n } from '@client/i18n'; +import { ui } from '@client/config'; import { $i } from './account'; import { unisonReload } from '@client/scripts/unison-reload'; import { router } from './router'; @@ -184,35 +185,40 @@ export const menuDef = { action: (ev) => { os.popupMenu([{ text: i18n.locale.default, + active: ui === 'default' || ui === null, action: () => { localStorage.setItem('ui', 'default'); unisonReload(); } }, { text: i18n.locale.deck, + active: ui === 'deck', action: () => { localStorage.setItem('ui', 'deck'); unisonReload(); } }, { - text: 'pope', + text: i18n.locale.classic, + active: ui === 'classic', action: () => { - localStorage.setItem('ui', 'pope'); + localStorage.setItem('ui', 'classic'); unisonReload(); } }, { text: 'Chat (β)', + active: ui === 'chat', action: () => { localStorage.setItem('ui', 'chat'); unisonReload(); } - }, { + }, /*{ text: i18n.locale.desktop + ' (β)', + active: ui === 'desktop', action: () => { localStorage.setItem('ui', 'desktop'); unisonReload(); } - }], ev.currentTarget || ev.target); + }*/], ev.currentTarget || ev.target); }, }, }; diff --git a/src/client/ui/default.header.vue b/src/client/ui/classic.header.vue similarity index 100% rename from src/client/ui/default.header.vue rename to src/client/ui/classic.header.vue diff --git a/src/client/ui/default.side.vue b/src/client/ui/classic.side.vue similarity index 100% rename from src/client/ui/default.side.vue rename to src/client/ui/classic.side.vue diff --git a/src/client/ui/default.sidebar.vue b/src/client/ui/classic.sidebar.vue similarity index 100% rename from src/client/ui/default.sidebar.vue rename to src/client/ui/classic.sidebar.vue diff --git a/src/client/ui/default.vue b/src/client/ui/classic.vue similarity index 98% rename from src/client/ui/default.vue rename to src/client/ui/classic.vue index 792aa197a..79cdbe3af 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/classic.vue @@ -64,7 +64,7 @@ import { defineComponent, defineAsyncComponent, markRaw } from 'vue'; import { instanceName } from '@client/config'; import { StickySidebar } from '@client/scripts/sticky-sidebar'; -import XSidebar from './default.sidebar.vue'; +import XSidebar from './classic.sidebar.vue'; import XDrawerSidebar from '@client/ui/_common_/sidebar.vue'; import XCommon from './_common_/common.vue'; import * as os from '@client/os'; @@ -79,8 +79,8 @@ export default defineComponent({ XCommon, XSidebar, XDrawerSidebar, - XHeaderMenu: defineAsyncComponent(() => import('./default.header.vue')), - XWidgets: defineAsyncComponent(() => import('./default.widgets.vue')), + XHeaderMenu: defineAsyncComponent(() => import('./classic.header.vue')), + XWidgets: defineAsyncComponent(() => import('./classic.widgets.vue')), }, provide() { diff --git a/src/client/ui/default.widgets.vue b/src/client/ui/classic.widgets.vue similarity index 100% rename from src/client/ui/default.widgets.vue rename to src/client/ui/classic.widgets.vue diff --git a/src/client/ui/universal.vue b/src/client/ui/universal.vue index e79ad80f6..d8f1c2a93 100644 --- a/src/client/ui/universal.vue +++ b/src/client/ui/universal.vue @@ -58,7 +58,7 @@ import { instanceName } from '@client/config'; import { StickySidebar } from '@client/scripts/sticky-sidebar'; import XSidebar from '@client/ui/_common_/sidebar.vue'; import XCommon from './_common_/common.vue'; -import XSide from './default.side.vue'; +import XSide from './classic.side.vue'; import * as os from '@client/os'; import { menuDef } from '@client/menu'; import * as symbols from '@client/symbols';