@@ -2,7 +2,8 @@ import { useEffect, useState } from 'react';
22import Image from 'next/image' ;
33import { decode } from 'html-entities' ;
44import { NewsLetterSubmitButton } from '@/components/buttons/SubmitButton' ;
5- import S from './styles' ;
5+ import styles from './NewsletterForm.module.scss' ;
6+ import Container from '@/components/containers/Container' ;
67
78const NewsletterForm = ( { status, message, subscribe, getReCaptchaToken } ) => {
89 const [ error , setError ] = useState ( null ) ;
@@ -109,29 +110,31 @@ const NewsletterForm = ({ status, message, subscribe, getReCaptchaToken }) => {
109110 } ;
110111
111112 return (
112- < S . Section >
113- < S . InnerContainer >
114- < S . Title >
113+ < section className = { styles . section } >
114+ < Container className = { styles . innerContainer } >
115+ < h2 className = { styles . title } >
115116 Sign up for news
116- < S . RightChevron >
117+ < span className = { styles . rightChevron } >
117118 < Image
118119 src = '/images/svg/right-chevron.svg'
119120 height = { 18 }
120121 width = { 18 }
121122 alt = 'Right Chevron SVG'
122123 />
123- </ S . RightChevron >
124- </ S . Title >
124+ </ span >
125+ </ h2 >
125126 < div >
126- < S . Form onSubmit = { handleFormSubmit } >
127- < S . InputName
127+ < form className = { styles . form } onSubmit = { handleFormSubmit } >
128+ < input
129+ className = { styles . inputName }
128130 onChange = { event => setName ( event ?. target ?. value ?? '' ) }
129131 type = 'text'
130132 name = 'name'
131133 value = { name }
132134 placeholder = 'name'
133135 />
134- < S . InputEmail
136+ < input
137+ className = { styles . inputEmail }
135138 onChange = { event => setEmail ( event ?. target ?. value ?? '' ) }
136139 type = 'email'
137140 name = 'email'
@@ -140,32 +143,36 @@ const NewsletterForm = ({ status, message, subscribe, getReCaptchaToken }) => {
140143 onKeyUp = { event => handleInputKeyEvent ( event ) }
141144 />
142145 < NewsLetterSubmitButton label = 'Subscribe' />
143- </ S . Form >
146+ </ form >
144147
145- < S . FormInfo >
148+ < div className = { styles . formInfo } >
146149 { reCaptchaFail && (
147- < S . FormSending >
150+ < div className = { styles . formSending } >
148151 Please, refresh your screen and try it again.
149- </ S . FormSending >
152+ </ div >
150153 ) }
151154
152- { status === 'sending' && < S . FormSending > Sending...</ S . FormSending > }
155+ { status === 'sending' && (
156+ < div className = { styles . formSending } > Sending...</ div >
157+ ) }
153158 { status === 'error' || error ? (
154- < S . FormError
159+ < div
160+ className = { styles . formError }
155161 dangerouslySetInnerHTML = { {
156162 __html : error || getMessage ( message ) ,
157163 } }
158164 />
159165 ) : null }
160166 { status === 'success' && status !== 'error' && ! error && (
161- < S . FormSuccess
167+ < div
168+ className = { styles . formSuccess }
162169 dangerouslySetInnerHTML = { { __html : decode ( message ) } }
163170 />
164171 ) }
165- </ S . FormInfo >
172+ </ div >
166173 </ div >
167- </ S . InnerContainer >
168- </ S . Section >
174+ </ Container >
175+ </ section >
169176 ) ;
170177} ;
171178
0 commit comments