From fa36b88af41cf96bd975189f30ca5354d14679d9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 3 Dec 2021 22:09:40 +0900 Subject: [PATCH] refactor(client): refactor ui components --- packages/client/src/menu.ts | 6 +- packages/client/src/os.ts | 2 +- .../src/ui/_common_/sidebar-for-mobile.vue | 205 +++++++ packages/client/src/ui/_common_/sidebar.vue | 565 ++++++++---------- packages/client/src/ui/classic.vue | 141 +---- packages/client/src/ui/deck.vue | 289 +++++---- packages/client/src/ui/universal.vue | 295 +++++---- 7 files changed, 814 insertions(+), 689 deletions(-) create mode 100644 packages/client/src/ui/_common_/sidebar-for-mobile.vue diff --git a/packages/client/src/menu.ts b/packages/client/src/menu.ts index ae74740bb..bd155ba16 100644 --- a/packages/client/src/menu.ts +++ b/packages/client/src/menu.ts @@ -1,4 +1,4 @@ -import { computed, ref } from 'vue'; +import { computed, ref, reactive } from 'vue'; import { search } from '@/scripts/search'; import * as os from '@/os'; import { i18n } from '@/i18n'; @@ -7,7 +7,7 @@ import { $i } from './account'; import { unisonReload } from '@/scripts/unison-reload'; import { router } from './router'; -export const menuDef = { +export const menuDef = reactive({ notifications: { title: 'notifications', icon: 'fas fa-bell', @@ -221,4 +221,4 @@ export const menuDef = { }*/], ev.currentTarget || ev.target); }, }, -}; +}); diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 30f6b3596..37b57557c 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -556,7 +556,7 @@ export function contextMenu(items: any[], ev: MouseEvent) { }); } -export function post(props: Record) { +export function post(props: Record = {}) { return new Promise((resolve, reject) => { // NOTE: MkPostFormDialogをdynamic importするとiOSでテキストエリアに自動フォーカスできない // NOTE: ただ、dynamic importしない場合、MkPostFormDialogインスタンスが使いまわされ、 diff --git a/packages/client/src/ui/_common_/sidebar-for-mobile.vue b/packages/client/src/ui/_common_/sidebar-for-mobile.vue new file mode 100644 index 000000000..5babdb98a --- /dev/null +++ b/packages/client/src/ui/_common_/sidebar-for-mobile.vue @@ -0,0 +1,205 @@ + + + + + diff --git a/packages/client/src/ui/_common_/sidebar.vue b/packages/client/src/ui/_common_/sidebar.vue index 6abb21d96..00e95d366 100644 --- a/packages/client/src/ui/_common_/sidebar.vue +++ b/packages/client/src/ui/_common_/sidebar.vue @@ -1,385 +1,300 @@ diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 011370f7f..352163d05 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -1,9 +1,9 @@