diff options
| author | CenTdemeern1 <timo.herngreen@gmail.com> | 2024-10-13 00:57:41 +0200 |
|---|---|---|
| committer | CenTdemeern1 <timo.herngreen@gmail.com> | 2024-10-13 01:03:29 +0200 |
| commit | 5085c39440d471b00319eb4ebb2b3169f0cefcd7 (patch) | |
| tree | 5aaa295250b06de89e6670afd3501008a50c1a65 /packages | |
| parent | merge: Fix: Finding emoji that include capital letters (!676) (diff) | |
| download | sharkey-5085c39440d471b00319eb4ebb2b3169f0cefcd7.tar.gz sharkey-5085c39440d471b00319eb4ebb2b3169f0cefcd7.tar.bz2 sharkey-5085c39440d471b00319eb4ebb2b3169f0cefcd7.zip | |
Implement clickable notifications
I'm not sure about the get function pattern here as it doesn't include a value to base reactivity on; I might be too used to Svelte though and maybe that's fine
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/frontend/src/pages/settings/general.vue | 3 | ||||
| -rw-r--r-- | packages/frontend/src/store.ts | 4 | ||||
| -rw-r--r-- | packages/frontend/src/ui/_common_/common.vue | 11 |
3 files changed, 16 insertions, 2 deletions
diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 41046a4bd9..ebf397bf5b 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -170,6 +170,8 @@ SPDX-License-Identifier: AGPL-3.0-only <option value="horizontal"><i class="ti ti-carousel-horizontal"></i> {{ i18n.ts.horizontal }}</option> </MkRadios> + <MkSwitch v-model="notificationClickable">{{ i18n.ts.allowClickingNotifications }}</MkSwitch> + <MkButton @click="testNotification">{{ i18n.ts._notification.checkNotificationBehavior }}</MkButton> </div> </FormSection> @@ -411,6 +413,7 @@ const showAvatarDecorations = computed(defaultStore.makeGetterSetter('showAvatar const mediaListWithOneImageAppearance = computed(defaultStore.makeGetterSetter('mediaListWithOneImageAppearance')); const notificationPosition = computed(defaultStore.makeGetterSetter('notificationPosition')); const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis')); +const notificationClickable = computed(defaultStore.makeGetterSetter('notificationClickable')); const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn')); const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline')); const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications')); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 8665cdaf76..fe8fb25219 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -468,6 +468,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: 'horizontal' as 'vertical' | 'horizontal', }, + notificationClickable: { + where: 'device', + default: false, + }, enableCondensedLineForAcct: { where: 'device', default: false, diff --git a/packages/frontend/src/ui/_common_/common.vue b/packages/frontend/src/ui/_common_/common.vue index 442b6479dd..2f4deddfcd 100644 --- a/packages/frontend/src/ui/_common_/common.vue +++ b/packages/frontend/src/ui/_common_/common.vue @@ -30,7 +30,11 @@ SPDX-License-Identifier: AGPL-3.0-only :enterFromClass="defaultStore.state.animation ? $style.transition_notification_enterFrom : ''" :leaveToClass="defaultStore.state.animation ? $style.transition_notification_leaveTo : ''" > - <div v-for="notification in notifications" :key="notification.id" :class="$style.notification"> + <div + v-for="notification in notifications" :key="notification.id" :class="$style.notification" :style="{ + pointerEvents: getPointerEvents() + }" + > <XNotification :notification="notification"/> </div> </TransitionGroup> @@ -101,6 +105,10 @@ if ($i) { swInject(); } } + +function getPointerEvents() { + return defaultStore.state.notificationClickable ? undefined : 'none'; +} </script> <style lang="scss" module> @@ -122,7 +130,6 @@ if ($i) { position: fixed; z-index: 3900000; padding: 0 var(--margin); - pointer-events: none; display: flex; &.notificationsPosition_leftTop { |