@@ -2,7 +2,7 @@ import { useForm } from 'react-hook-form';
22import Container from '@/components/containers/Container' ;
33import RevealContentContainer from '@/components/containers/RevealContentContainer' ;
44import { SubmitButton } from '@/components/buttons/SubmitButton' ;
5- import S from './styles ' ;
5+ import styles from './ContactUsForm.module.scss ' ;
66
77function ContactUsForm ( { subscribe, setResponseMessage, getReCaptchaToken } ) {
88 const {
@@ -69,8 +69,9 @@ function ContactUsForm({ subscribe, setResponseMessage, getReCaptchaToken }) {
6969 return (
7070 < RevealContentContainer >
7171 < Container >
72- < S . Form onSubmit = { handleSubmit ( onSubmit ) } >
73- < S . Input
72+ < form className = { styles . form } onSubmit = { handleSubmit ( onSubmit ) } >
73+ < input
74+ className = { styles . input }
7475 type = 'text'
7576 placeholder = 'name'
7677 { ...register ( 'Name' , {
@@ -81,27 +82,29 @@ function ContactUsForm({ subscribe, setResponseMessage, getReCaptchaToken }) {
8182 pattern : / [ ^ \s - ] / i,
8283 } ) }
8384 />
84- < S . ErrorMsg >
85+ < p className = { styles [ 'error-msg' ] } >
8586 { errors . Name ?. type === 'required'
8687 ? 'Name is required'
8788 : errors . Name ?. type === 'pattern'
88- ? 'No whitespace'
89- : errors . Name ?. type === 'minLength'
90- ? 'Must be more than 1 character'
91- : undefined }
92- </ S . ErrorMsg >
93- < S . Input
89+ ? 'No whitespace'
90+ : errors . Name ?. type === 'minLength'
91+ ? 'Must be more than 1 character'
92+ : undefined }
93+ </ p >
94+ < input
95+ className = { styles . input }
9496 type = 'email'
9597 placeholder = 'email'
9698 { ...register ( 'Email' , {
9799 required : true ,
98100 pattern : / ^ \S + @ \S + $ / i,
99101 } ) }
100102 />
101- < S . ErrorMsg >
103+ < p className = { styles [ 'error-msg' ] } >
102104 { errors . Email ?. type === 'required' && 'Email is required' }
103- </ S . ErrorMsg >
104- < S . Input
105+ </ p >
106+ < input
107+ className = { styles . input }
105108 type = 'text'
106109 placeholder = 'subject'
107110 { ...register ( 'Subject' , {
@@ -110,42 +113,44 @@ function ContactUsForm({ subscribe, setResponseMessage, getReCaptchaToken }) {
110113 pattern : / [ ^ \s - ] / i,
111114 } ) }
112115 />
113- < S . ErrorMsg >
116+ < p className = { styles [ 'error-msg' ] } >
114117 { errors . Subject ?. type === 'required'
115118 ? 'Subject is required'
116119 : errors . Subject ?. type === 'pattern'
117- ? 'No whitespace'
118- : errors . Subject ?. type === 'minLength'
119- ? 'Must be more than 1 character'
120- : undefined }
121- </ S . ErrorMsg >
122- < S . TextArea
120+ ? 'No whitespace'
121+ : errors . Subject ?. type === 'minLength'
122+ ? 'Must be more than 1 character'
123+ : undefined }
124+ </ p >
125+ < textarea
126+ className = { styles . textarea }
123127 { ...register ( 'Message' , {
124128 required : true ,
125129 minLength : 2 ,
126130 pattern : / [ ^ \s - ] / i,
127131 } ) }
128132 placeholder = 'Write your message here'
129133 />
130- < S . ErrorMsg >
134+ < p className = { styles [ 'error-msg' ] } >
131135 { errors . Message ?. type === 'required'
132136 ? 'Message is required'
133137 : errors . Message ?. type === 'pattern'
134- ? 'No whitespace'
135- : errors . Message ?. type === 'minLength'
136- ? 'Must be more than 1 character'
137- : undefined }
138- </ S . ErrorMsg >
139- < S . SubscribeWrapper >
140- < S . SubscribeInput
138+ ? 'No whitespace'
139+ : errors . Message ?. type === 'minLength'
140+ ? 'Must be more than 1 character'
141+ : undefined }
142+ </ p >
143+ < label className = { styles [ 'subscribe-wrapper' ] } >
144+ < input
145+ className = { styles [ 'subscribe-input' ] }
141146 type = 'checkbox'
142147 placeholder = 'Subscribe to our DevNews!'
143148 { ...register ( 'Subscribe' , { } ) }
144149 />
145150 Subscribe to our DevNews!
146- </ S . SubscribeWrapper >
151+ </ label >
147152 < SubmitButton label = 'Submit' disabled = { isSubmitting } />
148- </ S . Form >
153+ </ form >
149154 </ Container >
150155 </ RevealContentContainer >
151156 ) ;
0 commit comments