47 lines
1.6 KiB
Vue
47 lines
1.6 KiB
Vue
<script setup lang="ts">
|
|
import { useForm } from '@inertiajs/vue3';
|
|
import Button from '@/components/ui/Button.vue';
|
|
import SettingsCard from '@/components/SettingsCard.vue';
|
|
import ToggleField from '@/components/ToggleField.vue';
|
|
import { useTranslations } from '@/composables/useVanguard';
|
|
import AppLayout from '@/layouts/AppLayout.vue';
|
|
|
|
const props = defineProps<{ values: { notifications_signup_email: number } }>();
|
|
|
|
const { __ } = useTranslations();
|
|
|
|
const form = useForm({
|
|
notifications_signup_email: Number(props.values.notifications_signup_email ?? 0),
|
|
});
|
|
|
|
function submit() {
|
|
form.post(route('settings.notifications.update'), { preserveScroll: true });
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<AppLayout
|
|
:title="__('Notification Settings')"
|
|
:heading="__('Notification Settings')"
|
|
:breadcrumbs="[{ label: __('Settings') }, { label: __('Notifications') }]"
|
|
>
|
|
<form class="max-w-2xl" @submit.prevent="submit">
|
|
<SettingsCard :title="__('Email Notifications')">
|
|
<ToggleField
|
|
v-model="form.notifications_signup_email"
|
|
input-id="switch-signup-email"
|
|
:label="__('Sign-Up Notification')"
|
|
:description="__('Send an email to the Administrators when user signs up.')"
|
|
/>
|
|
|
|
<Button
|
|
type="submit"
|
|
:label="__('Update')"
|
|
class="mt-6"
|
|
:loading="form.processing"
|
|
/>
|
|
</SettingsCard>
|
|
</form>
|
|
</AppLayout>
|
|
</template>
|