From 3ec3db6208dd8f4c42b0cd519bdeb4c1a2d051e9 Mon Sep 17 00:00:00 2001 From: Tajim Date: Tue, 25 Aug 2026 23:54:35 +0600 Subject: [PATCH] feat(profile): de-emphasize email preference and add dark friction confirmation UX --- resources/js/pages/Profile.vue | 202 +++++++++++++++++++++++++-------- 1 file changed, 154 insertions(+), 48 deletions(-) diff --git a/resources/js/pages/Profile.vue b/resources/js/pages/Profile.vue index cf0a15a..956dd0e 100644 --- a/resources/js/pages/Profile.vue +++ b/resources/js/pages/Profile.vue @@ -9,8 +9,10 @@ import { Sparkles, ArrowRight, Mail, + AlertTriangle, + ChevronDown, } from 'lucide-vue-next'; -import { computed } from 'vue'; +import { computed, ref } from 'vue'; const props = defineProps({ user: Object, @@ -25,6 +27,9 @@ const hasNoRole = computed(() => { return !roles || roles.length === 0; }); +const showAdvancedSettings = ref(false); +const showConfirmModal = ref(false); + const form = useForm({ _method: 'PUT', name: user.value?.name || '', @@ -38,6 +43,19 @@ const form = useForm({ receive_emails: user.value?.receive_emails ?? true, }); +const handleEmailToggle = () => { + if (form.receive_emails) { + showConfirmModal.value = true; + } else { + form.receive_emails = true; + } +}; + +const confirmDisable = () => { + form.receive_emails = false; + showConfirmModal.value = false; +}; + const submitForm = () => { form.post('/profile', { preserveScroll: true, @@ -451,62 +469,96 @@ const submitForm = () => { - +
-
-
- -
-
-

+ Advanced Notification Preferences + - Email Preferences -

-

- Manage what email announcements and updates you - receive. -

+ Updates Paused +
-
+ + -
-
- -

- Stay up-to-date with new resources, study materials, - and platform announcements. -

-
- - -
+ v-if="!form.receive_emails" + class="mt-3 flex items-start gap-2.5 rounded-lg border border-amber-200/80 bg-amber-50/80 p-2.5 text-xs text-amber-800 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-300" + > + +
+ You may miss critical updates: + Disabling this will prevent you from receiving vital academic alerts, syllabus updates, and new study materials. + +
+
+ + @@ -525,5 +577,59 @@ const submitForm = () => { + + + +
+
+
+
+ +
+
+

+ Turn off essential announcements? +

+

+ You will stop receiving critical syllabus announcements, new exam preparation materials, and platform alerts. We strongly recommend keeping this enabled. +

+
+
+ +
+ + +
+
+
+