-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContactMe.tsx
61 lines (52 loc) · 2.59 KB
/
ContactMe.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import React from 'react'
import { EnvelopeIcon, MapPinIcon, PhoneIcon } from '@heroicons/react/24/solid'
import { SubmitHandler,useForm } from 'react-hook-form';
type Inputs = {
name:string;
email:string;
subject:string;
message:string;
};
type Props={
}
function ContactMe({}: Props) {
const { register, handleSubmit}= useForm<Inputs>();
const onSubmit: SubmitHandler<Inputs> =(formData)=>{
window.location.href=`mailto:albinsullas13@gmail.com?subject=${formData.subject}&body=Hi,my name is ${formData.name}.${formData.message}(
${formData.email}
)`
}
return (
<div className='h-screen flex relative flex-col text-center md:text-left md:flex-row
max-w-7xl px-10 justify-evenly mx-auto items-center
'>
<h3 className='absolute top-24 uppercase tracking-[20px] text-gray-500 text-2xl'>Contact</h3>
<div className="flex flex-col space-y-10 mt-[40px]">
<div className='mt-[70px] space-y-2 '>
<div className='flex items-center space-x-5 justify-center'>
<PhoneIcon className='text-sm h-4 w-4 text-[#F7Ab0A] animate-pulse '/>
<p>+91 9544697960</p>
</div>
<div className='flex items-center space-x-5 justify-center'>
<MapPinIcon className='text-sm h-4 w-4 text-[#F7Ab0A] animate-pulse '/>
<p>Pathanamthitta.Kerala.India</p>
</div>
<div className='flex items-center space-x-5 justify-center'>
<EnvelopeIcon className='text-sm h-4 w-4 text-[#F7Ab0A] animate-pulse '/>
<p>albinsullas13@gmail.com</p>
</div>
</div>
<form onSubmit={handleSubmit(onSubmit)} className='flex flex-col space-y-2 w-fit mx-auto '>
<div className='flex space-x-2'>
<input {...register('name')} placeholder='Name' className='contactInput' type="text"/>
<input {...register('email')}placeholder='Email' className='contactInput'type="email"/>
</div>
<input {...register('subject')} placeholder="Subject" className='contactInput' type="text"/>
<textarea {...register('message')} placeholder="Message" className='contactInput'/>
<button type="submit" className='bg-[#F7AB0A]/70 hover:bg-[#F7AB0A] py-2 rounded-md text-black font-bold text-lg '>submit</button>
</form>
</div>
</div>
)
}
export default ContactMe