feat(contact): add toast notifications for form feedback
- Add toast notifications for contact form success/error responses - Add toast notifications for backend errors in AppFooter - Add accessibility explanation for honeypot field - Add loading state to contact form submit button - Add i18n translations for toast messages (en/fr) - Fix honeypot input missing v-model binding
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
import type { NavigationMenuItem } from '@nuxt/ui';
|
||||
import { version } from '../../package.json';
|
||||
|
||||
const toast = useToast();
|
||||
const { isMobile } = useDevice();
|
||||
const orientation = computed(() => (isMobile ? 'vertical' : 'horizontal'));
|
||||
const { getMeta } = useBackend();
|
||||
@@ -48,4 +49,13 @@ const items = computed<NavigationMenuItem[]>(() => [
|
||||
to: 'https://rust-lang.org/',
|
||||
},
|
||||
]);
|
||||
watch(error, (value) => {
|
||||
if (value) {
|
||||
toast.add({
|
||||
title: $t('backend.errors.title'),
|
||||
description: $t(value.message ?? 'backend.errors.unknown'),
|
||||
color: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user