1
- import React , { useState } from "react" ;
1
+ import React from "react" ;
2
2
import Navbar from "../components/Navbar" ;
3
3
import Footer from "../components/Footer" ;
4
- import axios from "axios" ;
5
- import env from "react-dotenv" ;
6
-
7
- import {
8
- FaDiscord ,
9
- FaReddit ,
10
- FaLinkedin ,
11
- FaEnvelope ,
12
- FaTwitter ,
13
- FaNetworkWired
14
- } from 'react-icons/fa' ;
15
-
4
+ import Contact from "../components/Contact" ;
16
5
const Contacts = ( ) => {
17
- const url = env . url ;
18
- const [ data , setData ] = useState ( {
19
- name : "" ,
20
- email : "" ,
21
- message : "" ,
22
- } ) ;
23
- function handle ( e ) {
24
- const newData = { ...data } ;
25
- newData [ e . target . id ] = e . target . value ;
26
- setData ( newData ) ;
27
- console . log ( newData ) ;
28
- }
29
- function submit ( e ) {
30
- e . preventDefault ( ) ;
31
- console . log ( "click" ) ;
32
- axios
33
- . post ( url , {
34
- name : data . name ,
35
- email : data . email ,
36
- message : data . message ,
37
- } )
38
- . then ( ( res ) => {
39
- console . log ( res . data ) ;
40
- alert ( "Thanks for Equiring we will shortly contact you :)" ) ;
41
- setData ( {
42
- name : "" ,
43
- email : "" ,
44
- message : "" ,
45
- } ) ;
46
- } ) ;
47
- }
48
- return (
49
- < div >
50
- < Navbar />
51
- < section class = "text-gray-400 bg-gray-1000 body-font " >
52
- < div class = "container px-5 py-24 mx-auto" >
53
- < div class = "flex flex-col text-center w-full mb-12" >
54
- < h1 class = "sm:text-3xl text-2xl font-medium title-font mb-4 text-white" >
55
- Contact Us
56
- </ h1 >
57
- < p class = "lg:w-2/3 mx-auto leading-relaxed text-base" > </ p >
58
- </ div >
59
- < div className = "lg:w-1/2 md:w-2/3 mx-auto mb-8" >
60
- < div className = "flex justify-center md:space-x-12 lg:space-x-14 xl:space-x-20 space-x-6" >
61
- < div className = "w-12 h-10 flex flex-col items-center" >
62
- < a href = "https://discord.com/invite/4xruwjjU9B" target = "discord" > < FaDiscord className = " hover:fill-current hover:text-[#0DFF1C] hover:w-12 " size = { 40 } /> </ a >
63
- </ div >
64
- < div className = "w-12 h-10 flex flex-col items-center" >
65
- < a href = "https://www.reddit.com/r/fosscu/" target = "discord" > < FaReddit className = " hover:fill-current hover:text-[#0DFF1C] hover:w-12 " size = { 40 } /> </ a >
66
- </ div >
67
- < div className = "w-12 h-10 flex flex-col items-center" >
68
- < a href = "Mailto:[email protected] " target = "mail" > < FaEnvelope className = " hover:fill-current hover:text-[#0DFF1C] hover:w-12 hover:h-10" size = { 35 } /> </ a >
69
- </ div >
70
- < div className = "w-12 h-10 flex flex-col items-center" >
71
- < a href = "https://www.linkedin.com/company/fosscu/" target = "linkedin" > < FaLinkedin className = " fill-current hover:text-[#0DFF1C] hover:w-12 hover:h-10" size = { 35 } /> </ a >
72
- </ div >
73
- < div className = "w-12 h-10 flex flex-col items-center" >
74
- < a href = "https://twitter.com/fosscuk" target = "twitter" > < FaTwitter className = " fill-current hover:text-[#0DFF1C] hover:w-12 hover:h-10 " size = { 35 } /> </ a >
75
- </ div >
76
- < div className = "w-12 h-10 flex flex-col items-center" >
77
- < a href = "https://matrix.to/#/#fosscu:matrix.org" target = "Matrix" > < FaNetworkWired className = " fill-current hover:text-[#0DFF1C] hover:w-12 hover:h-10 " size = { 35 } /> </ a >
78
- </ div >
79
- </ div >
80
- </ div >
81
- < div class = "lg:w-1/2 md:w-2/3 mx-auto" >
82
- < form class = "flex flex-wrap -m-2" onSubmit = { ( e ) => submit ( e ) } >
83
- < div class = "p-2 w-1/2" >
84
- < div class = "" >
85
- < label for = "name" class = "leading-7 text-sm text-gray-400" >
86
- Name
87
- </ label >
88
- < input
89
- type = "text"
90
- id = "name"
91
- onChange = { ( e ) => handle ( e ) }
92
- value = { data . name }
93
- class = "w-full bg-gray-800 hover:outline-2 bg-opacity-40 rounded border border-gray-700 focus:border-[#0dff1c] focus:bg-gray-900 focus:ring-2 focus:ring-[#0dff1c] text-base outline-none text-gray-100 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
94
- />
95
- </ div >
96
- </ div >
97
- < div class = "p-2 w-1/2" >
98
- < div class = "" >
99
- < label for = "email" class = "leading-7 text-sm text-gray-400" >
100
- Email
101
- </ label >
102
- < input
103
- type = "email"
104
- id = "email"
105
- name = "email"
106
- onChange = { ( e ) => handle ( e ) }
107
- value = { data . email }
108
- class = "w-full bg-gray-800 bg-opacity-40 rounded border border-gray-700 focus:border-[#0dff1c] focus:bg-gray-900 focus:ring-2 focus:ring-[#0dff1c] text-base outline-none text-gray-100 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
109
- />
110
- </ div >
111
- </ div >
112
- < div class = "p-2 w-full" >
113
- < div class = "" >
114
- < label for = "message" class = "leading-7 text-sm text-gray-400" >
115
- Message
116
- </ label >
117
- < textarea
118
- id = "message"
119
- name = "message"
120
- onChange = { ( e ) => handle ( e ) }
121
- value = { data . message }
122
- class = "w-full bg-gray-800 bg-opacity-40 rounded border border-gray-700 focus:border-[#0dff1c] focus:bg-gray-900 focus:ring-2 focus:ring-[#0dff1c] h-32 text-base outline-none text-gray-100 py-1 px-3 resize-none leading-6 transition-colors duration-200 ease-in-out"
123
- > </ textarea >
124
- </ div >
125
- </ div >
126
- < div class = "p-2 w-full" >
127
- < button class = "flex mx-auto tracking-tight font-semibold text-black bg-[#00ff11c4] border-0 py-2 px-8 focus:outline-none hover:bg-[#0dff1c] rounded text-lg" >
128
- Submit
129
- </ button >
130
- </ div >
131
- </ form >
132
- </ div >
6
+ return (
7
+ < div >
8
+ < Navbar />
9
+ < Contact />
10
+ < Footer />
133
11
</ div >
134
- </ section >
135
- < Footer />
136
- </ div >
137
- ) ;
12
+ ) ;
138
13
} ;
139
14
140
- export default Contacts ;
15
+ export default Contacts ;
0 commit comments