From c3003cb363315d3a16c09649354ab57e34003551 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 28 Jul 2019 05:25:12 +0900 Subject: [PATCH] Improve mobile notifications view --- locales/ja-JP.yml | 4 ++ src/client/app/common/scripts/paging.ts | 1 + .../views/components/settings/settings.vue | 6 ++ src/client/app/mobile/script.ts | 2 + .../mobile/views/components/notification.vue | 21 ++++++ .../mobile/views/components/notifications.vue | 32 ++++++++- .../app/mobile/views/components/ui.nav.vue | 7 +- .../app/mobile/views/pages/notifications.vue | 68 +++++++++++++++++++ src/client/app/store.ts | 1 + 9 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 src/client/app/mobile/views/pages/notifications.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 437a0b115a..526f9b0f35 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -225,6 +225,7 @@ common: use-avatar-reversi-stones: "リバーシの石にアバターを使う" disable-animated-mfm: "投稿内の動きのあるテキストを無効にする" disable-showing-animated-images: "アニメーション画像を再生しない" + enable-quick-notification-view: "通知のクイックビューを有効にする" suggest-recent-hashtags: "最近のハッシュタグを投稿フォームに表示する" always-show-nsfw: "常に閲覧注意のメディアを表示する" always-mark-nsfw: "常にメディアを閲覧注意として投稿" @@ -1894,6 +1895,9 @@ mobile/views/pages/search.vue: mobile/views/pages/selectdrive.vue: select-file: "ファイルを選択" +mobile/views/pages/notifications.vue: + notifications: "通知" + mobile/views/pages/settings.vue: signed-in-as: "{}としてサインイン中" diff --git a/src/client/app/common/scripts/paging.ts b/src/client/app/common/scripts/paging.ts index cf36a692d2..289a72a6ab 100644 --- a/src/client/app/common/scripts/paging.ts +++ b/src/client/app/common/scripts/paging.ts @@ -67,6 +67,7 @@ export default (opts) => ({ async init() { this.fetching = true; + if (opts.beforeInit) opts.beforeInit(this); let params = typeof this.pagination.params === 'function' ? this.pagination.params(true) : this.pagination.params; if (params && params.then) params = await params; await this.$root.api(this.pagination.endpoint, { diff --git a/src/client/app/common/views/components/settings/settings.vue b/src/client/app/common/views/components/settings/settings.vue index 401d9423ae..c609a96722 100644 --- a/src/client/app/common/views/components/settings/settings.vue +++ b/src/client/app/common/views/components/settings/settings.vue @@ -47,6 +47,7 @@ {{ $t('@._settings.disable-animated-mfm') }} {{ $t('@._settings.disable-showing-animated-images') }} {{ $t('@._settings.remain-deleted-note') }} + {{ $t('@._settings.enable-quick-notification-view') }}
{{ $t('@._settings.line-width') }}
@@ -532,6 +533,11 @@ export default Vue.extend({ set(value) { this.$store.commit('device/set', { key: 'mobileNotificationPosition', value }); } }, + enableMobileQuickNotificationView: { + get() { return this.$store.state.device.enableMobileQuickNotificationView; }, + set(value) { this.$store.commit('device/set', { key: 'enableMobileQuickNotificationView', value }); } + }, + homeProfile: { get() { return this.$store.state.device.homeProfile; }, set(value) { this.$store.commit('device/set', { key: 'homeProfile', value }); } diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts index 6222409931..082b3e895f 100644 --- a/src/client/app/mobile/script.ts +++ b/src/client/app/mobile/script.ts @@ -14,6 +14,7 @@ import MkIndex from './views/pages/index.vue'; import MkSignup from './views/pages/signup.vue'; import MkSelectDrive from './views/pages/selectdrive.vue'; import MkDrive from './views/pages/drive.vue'; +import MkNotifications from './views/pages/notifications.vue'; import MkMessaging from './views/pages/messaging.vue'; import MkMessagingRoom from './views/pages/messaging-room.vue'; import MkNote from './views/pages/note.vue'; @@ -144,6 +145,7 @@ init((launch, os) => { { path: '/i/groups/:group', component: UI, props: route => ({ component: () => import('../common/views/pages/user-group-editor.vue').then(m => m.default), groupId: route.params.group }) }, { path: '/i/follow-requests', name: 'follow-requests', component: UI, props: route => ({ component: () => import('../common/views/pages/follow-requests.vue').then(m => m.default) }) }, { path: '/i/widgets', name: 'widgets', component: () => import('./views/pages/widgets.vue').then(m => m.default) }, + { path: '/i/notifications', name: 'notifications', component: MkNotifications }, { path: '/i/messaging', name: 'messaging', component: MkMessaging }, { path: '/i/messaging/group/:group', component: MkMessagingRoom }, { path: '/i/messaging/:user', component: MkMessagingRoom }, diff --git a/src/client/app/mobile/views/components/notification.vue b/src/client/app/mobile/views/components/notification.vue index 448d22cbe6..300a46e52a 100644 --- a/src/client/app/mobile/views/components/notification.vue +++ b/src/client/app/mobile/views/components/notification.vue @@ -100,6 +100,27 @@ export default Vue.extend({ diff --git a/src/client/app/store.ts b/src/client/app/store.ts index 18137c1ca9..d9f1631a82 100644 --- a/src/client/app/store.ts +++ b/src/client/app/store.ts @@ -75,6 +75,7 @@ const defaultDeviceSettings = { disableShowingAnimatedImages: false, expandUsersPhotos: true, expandUsersActivity: true, + enableMobileQuickNotificationView: false, }; export default (os: MiOS) => new Vuex.Store({