add form
This commit is contained in:
@@ -9,6 +9,7 @@ import Semeq from '~/components/logos/Semeq.astro'
|
||||
import Natura from '~/components/logos/Natura.astro'
|
||||
import Nissan from '~/components/logos/Nissan.astro'
|
||||
import Manserv from '~/components/logos/Manserv.astro'
|
||||
import Contact from './_components/Contact.astro'
|
||||
|
||||
import placeholder from './_assets/placeholder.png'
|
||||
import mulherdenegocios from './_assets/mulher-de-negocios.png'
|
||||
@@ -276,5 +277,12 @@ const trainer = data.course?.trainer ? await getEntry(data.course?.trainer) : nu
|
||||
</div>
|
||||
</Container>
|
||||
<!-- Cert End -->
|
||||
|
||||
<!-- Contact Form -->
|
||||
<Container>
|
||||
<Contact />
|
||||
</Container>
|
||||
<!-- Contact Form End -->
|
||||
</section>
|
||||
|
||||
</Layout>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
import Label from './_label.astro'
|
||||
import Input from './_input.astro'
|
||||
import Textarea from './_textarea.astro'
|
||||
|
||||
// https://n8n.eduseg.com.br/webhook/a377b3e0-b159-4536-98ab-e13822b60562
|
||||
|
||||
if (Astro.request.method === 'POST') {
|
||||
try {
|
||||
const data = await Astro.request.formData()
|
||||
console.log(data)
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
console.error(error.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
---
|
||||
|
||||
<form method="POST" class="lg:w-6/12 mx-auto flex flex-col gap-2.5">
|
||||
<Label>
|
||||
<span class="lg:w-14">Nome</span>
|
||||
<Input name="name" />
|
||||
</Label>
|
||||
<Label>
|
||||
<span class="lg:w-14">Email</span>
|
||||
<Input name="email" />
|
||||
</Label>
|
||||
<Label class="flex-col !items-start !gap-1">
|
||||
<span>Mensagem</span>
|
||||
<Textarea name="message" class="h-26" />
|
||||
</Label>
|
||||
|
||||
<button type="submit">Enviar</button>
|
||||
</form>
|
||||
|
||||
7
superpage/src/pages/_components/_input.astro
Normal file
7
superpage/src/pages/_components/_input.astro
Normal file
@@ -0,0 +1,7 @@
|
||||
<input
|
||||
class:list={[
|
||||
'bg-white/10 focus:bg-white focus:text-black rounded-xl p-4 w-full focus:outline-none transition duration-150',
|
||||
Astro.props.class,
|
||||
]}
|
||||
{...Astro.props}
|
||||
/>
|
||||
3
superpage/src/pages/_components/_label.astro
Normal file
3
superpage/src/pages/_components/_label.astro
Normal file
@@ -0,0 +1,3 @@
|
||||
<label class:list={['flex max-lg:flex-col lg:items-center gap-1 lg:gap-2.5', Astro.props.class]}>
|
||||
<slot />
|
||||
</label>
|
||||
8
superpage/src/pages/_components/_textarea.astro
Normal file
8
superpage/src/pages/_components/_textarea.astro
Normal file
@@ -0,0 +1,8 @@
|
||||
<textarea
|
||||
class:list={[
|
||||
'bg-white/10 focus:bg-white focus:text-black rounded-xl p-4 w-full focus:outline-none transition duration-150',
|
||||
Astro.props.class,
|
||||
]}
|
||||
{...Astro.props}
|
||||
>
|
||||
</textarea>
|
||||
Reference in New Issue
Block a user