@@ -3,6 +3,7 @@ import PrideText from "../../themes/PrideText";
33import Button from "../shared/styledComponents/Button" ;
44import { useState } from "react" ;
55import ModalWrapper from "../shared/styledComponents/Modal" ;
6+ import { useTranslation } from "react-i18next" ;
67
78const ContactFormContainer = styled . div `
89 background: ${ props => props . theme . settingsSectionBg || 'rgba(255, 255, 255, 0.02)' } ;
@@ -135,6 +136,7 @@ const SpamNotice = styled.div`
135136` ;
136137
137138export default function Contact ( ) {
139+ const { t } = useTranslation ( ) ;
138140 const [ message , setMessage ] = useState ( "" ) ;
139141 const [ contactInfo , setContactInfo ] = useState ( "" ) ;
140142
@@ -183,7 +185,7 @@ export default function Contact() {
183185 body : encode ( { "form-name" : "contact" , ...formValues } ) ,
184186 } )
185187 . then ( ( ) => {
186- alert ( "Success!" ) ;
188+ alert ( t ( "contact.successMessage" ) ) ;
187189 setMessage ( "" ) ;
188190 setContactInfo ( "" ) ;
189191 } )
@@ -196,29 +198,27 @@ export default function Contact() {
196198 < ContactFormContainer >
197199 < ContactFormHeader >
198200 < h2 >
199- < PrideText text = "💬 Send Me a Message" />
201+ < PrideText text = { t ( "contact.title" ) } />
200202 </ h2 >
201203 </ ContactFormHeader >
202204
203205 < ContactFormDescription >
204- It's always nice to hear from users! Whether you have a feature request,
205- feedback, or just want to say hi, I read every message. Include your contact
206- information if you'd like a response - I reply to every message that includes it.
206+ { t ( "contact.description" ) }
207207 </ ContactFormDescription >
208208
209209 < form name = "contact" method = "post" onSubmit = { handleSubmit } >
210210 < input type = "hidden" name = "form-name" value = "contact" />
211211
212212 < FormField >
213213 < StyledLabel >
214- Contact Info < OptionalText > (Optional) </ OptionalText >
214+ { t ( "contact.contactInfoLabel" ) } < OptionalText > { t ( "contact.optional" ) } </ OptionalText >
215215 </ StyledLabel >
216216 < StyleContactInfo
217217 value = { contactInfo }
218218 onChange = { onContactInfoChange }
219219 name = "contactInfo"
220220 type = "text"
221- placeholder = "Your email, Discord, etc."
221+ placeholder = { t ( "contact.contactInfoPlaceholder" ) }
222222 onKeyDown = { ( e ) => {
223223 e . key === "Enter" && e . preventDefault ( ) ;
224224 } }
@@ -227,33 +227,33 @@ export default function Contact() {
227227
228228 < FormField >
229229 < StyledLabel >
230- Message < RequiredText > (Required) </ RequiredText >
230+ { t ( "contact.messageLabel" ) } < RequiredText > { t ( "contact.required" ) } </ RequiredText >
231231 </ StyledLabel >
232232 < StyledTextArea
233233 value = { message }
234234 onChange = { onChange }
235235 name = "message"
236- placeholder = "Your message here..."
236+ placeholder = { t ( "contact.messagePlaceholder" ) }
237237 />
238238 </ FormField >
239239
240240 < SubmitButtonContainer >
241241 < Button onClick = { onClick } type = "submit" >
242- 📤 Send Message
242+ { t ( "contact.sendButton" ) }
243243 </ Button >
244244 </ SubmitButtonContainer >
245245
246246 < SpamNotice >
247247 < div className = "icon" > 📬</ div >
248248 < div className = "content" >
249- < strong > Important: </ strong > If you provided contact info and don't hear back within a few days, please check your spam/junk folder as my replies sometimes end up there.
249+ < strong > { t ( "contact.important" ) } </ strong > { t ( "contact.spamNotice" ) }
250250 </ div >
251251 </ SpamNotice >
252252
253253 < ModalWrapper
254- headerText = { < PrideText text = { `Submit without Contact Info` } /> }
255- bodyText = 'You did not provide any contact info for me to respond to you. Click "Close" to provide contact info or click "Submit" to continue without providing contact info. I cannot respond if you do not provide your contact info.'
256- confirmButtonText = "Submit"
254+ headerText = { < PrideText text = { t ( "contact.submitWithoutContactTitle" ) } /> }
255+ bodyText = { t ( " contact.submitWithoutContactBody" ) }
256+ confirmButtonText = { t ( "contact.submitButton" ) }
257257 handleClose = { handleClose }
258258 handleConfirm = { handleConfirm }
259259 show = { show }
0 commit comments