diff --git a/app.config.ts b/app.config.ts index 020e579..b76b954 100644 --- a/app.config.ts +++ b/app.config.ts @@ -28,12 +28,12 @@ export default defineAppConfig({ }, input: { variant: { - none: 'bg-gray-100 dark:bg-gray-900 border-1 border-gray-700 hover:border-gray-400 focus:border-gray-400 transition-colors duration-300 ease-in-out', + none: 'bg-gray-100 dark:bg-gray-900/40 border-1 border-gray-700 hover:border-gray-400 focus:border-gray-400 transition-colors duration-300 ease-in-out', }, }, textarea: { variant: { - none: 'bg-gray-100 dark:bg-gray-900 border-1 border-gray-700 hover:border-gray-400 focus:border-gray-400 transition-colors duration-300 ease-in-out', + none: 'bg-gray-100 dark:bg-gray-900/40 border-1 border-gray-700 hover:border-gray-400 focus:border-gray-400 transition-colors duration-300 ease-in-out', }, }, }, diff --git a/components/content/Contact.vue b/components/content/Contact.vue index e821519..0db7e8d 100644 --- a/components/content/Contact.vue +++ b/components/content/Contact.vue @@ -4,39 +4,11 @@ import type { ContactEmail } from '~/types/ContactEmail' const appConfig = useAppConfig() const { t } = useI18n() -const demandTypes = [ - { - label: 'contact.subject_types.project', - value: 'project', - color: 'bg-blue-500', - button_color: 'blue', - }, - { - label: 'contact.subject_types.question', - value: 'question', - color: 'bg-yellow-500', - button_color: 'yellow', - }, - { - label: 'contact.subject_types.bug', - value: 'bug', - color: 'bg-red-500', - button_color: 'red', - }, - { - label: 'contact.subject_types.other', - value: 'other', - color: 'bg-gray-500', - button_color: 'gray', - }, -] - const email = ref('') const message = ref('') const phone = ref('') const fullname = ref('') -const budget = ref(1000) -const selected = ref(demandTypes[0]) +const subject = ref('') const loading = ref(false) @@ -46,28 +18,26 @@ const contactData = computed(() => { message: message.value, phone: phone.value, fullname: fullname.value, - budget: budget.value, - subject: selected.value.value, + subject: subject.value, } as ContactEmail }) async function submitForm() { loading.value = true - const { data } = await useFetch('/api/sendEmail', { - method: 'POST', - body: contactData.value, - }) - if (data) { + try { + await $fetch('/api/sendEmail', { + method: 'POST', + body: contactData.value, + }) email.value = '' message.value = '' phone.value = '' fullname.value = '' - budget.value = 450 - selected.value = demandTypes[0] + subject.value = '' toast.success(t('contact.success')) } - else { - toast.success(t('contact.error')) + catch (error) { + toast.error(t('contact.error')) } loading.value = false } @@ -90,121 +60,74 @@ defineOgImage({ url: appConfig.openGraphImage, width: 1200, height: 630, alt: 'H @submit.prevent="submitForm" > -
- + -
+ -
- + -
+ -
- + -
+ -
- - - - - -
- - -
- - {{ $t("contact.budget") }}: {{ budget }}€ -
+ -
- + -
+
{{ $t("contact.submit") }} @@ -264,7 +188,3 @@ defineOgImage({ url: appConfig.openGraphImage, width: 1200, height: 630, alt: 'H
- - diff --git a/server/api/sendEmail.ts b/server/api/sendEmail.ts index edb0084..29affbb 100644 --- a/server/api/sendEmail.ts +++ b/server/api/sendEmail.ts @@ -7,7 +7,7 @@ const resend = new Resend(process.env.NUXT_PRIVATE_RESEND_API_KEY) export default defineEventHandler(async (event: H3Event) => { try { const body = (await readBody(event)) as ContactEmail - const { email, subject, message, phone, fullname, budget } = body + const { email, subject, message, phone, fullname } = body return await resend.emails.send({ from: 'HR Folio ', to: ['contact@hrcd.fr'], @@ -20,7 +20,6 @@ export default defineEventHandler(async (event: H3Event) => {
  • Email : ${email}
  • Téléphone : ${phone}
  • Sujet : ${subject}
  • -
  • Budget : ${budget}€
  • Message : ${message}
  • `,