Skip to content

Commit 8de28b7

Browse files
committed
refactor: Replace mailto hrefs with /contact
1 parent 6e0f22c commit 8de28b7

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

components/ContactUs/ContactUsForm/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import RevealContentContainer from '@/components/containers/RevealContentContain
44
import { SubmitButton } from '@/components/buttons/SubmitButton';
55
import styles from './ContactUsForm.module.scss';
66

7-
function ContactUsForm({ setResponseMessage, getReCaptchaToken }) {
7+
function ContactUsForm({ subject, setResponseMessage, getReCaptchaToken }) {
88
const {
99
register,
1010
handleSubmit,
@@ -14,7 +14,7 @@ function ContactUsForm({ setResponseMessage, getReCaptchaToken }) {
1414
defaultValues: {
1515
Name: '',
1616
Email: '',
17-
Subject: '',
17+
Subject: subject || '',
1818
Message: '',
1919
},
2020
});

components/ContactUs/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import React from 'react';
22
import ReCapchaWrapper from '../Recapcha';
33
import ContactUsForm from '@/components/ContactUs/ContactUsForm';
44

5-
const ContactUs = ({ setMsg }) => {
5+
const ContactUs = ({ subject, setMsg }) => {
66
return (
7-
<ReCapchaWrapper children={<ContactUsForm setResponseMessage={setMsg} />} />
7+
<ReCapchaWrapper
8+
children={<ContactUsForm subject={subject} setResponseMessage={setMsg} />}
9+
/>
810
);
911
};
1012

components/layout/Nav/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ export default function Nav() {
101101
);
102102
})}
103103
<li className={styles.item}>
104-
<a
105-
href='mailto:hello@webdevpath.co?subject=Project collaborator application'
104+
<Link
105+
href='/contact?subject=Project collaborator application'
106106
className={`
107107
${active ? styles.active : ''}
108108
${isSticky ? styles.buttonSticky : styles.button}
109109
`}
110110
title='Join us'
111111
>
112112
Join us
113-
</a>
113+
</Link>
114114
</li>
115115
</ul>
116116
<button

pages/about.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export default function AboutUs() {
207207
image='/images/svg/slash.svg'
208208
altTag=''
209209
customInnerClass='get-started'
210-
link='mailto:hello@webdevpath.co'
210+
link='/contact'
211211
linkText='Ping us'
212212
customBtnClass='inverted-grey'
213213
/>

pages/contact.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import { useState } from 'react';
2+
import { useSearchParams } from 'next/navigation';
23
import ContactUsFormSubscribe from '@/components/ContactUs';
34
import ContactUsCards from '@/components/ContactUs/ContactUsCards';
45
import styles from '@/styles/pages/contact.module.scss';
56
import Bracket from '@/components/decorations/Bracket';
67
import bracketStyles from '@/components/decorations/Bracket/Bracket.module.scss';
78
export default function ContactUs() {
89
const [message, setMessage] = useState([]);
9-
10+
const searchParams = useSearchParams();
1011
return (
1112
<>
1213
<div className={styles.contactUsContainer}>
1314
<div className={styles.formWrapper}>
1415
<div className={styles.formAndDecorations}>
1516
<Bracket className={bracketStyles.yellowBracket} />
16-
<ContactUsFormSubscribe setMsg={setMessage} />
17+
<ContactUsFormSubscribe
18+
subject={searchParams.get('subject')}
19+
setMsg={setMessage}
20+
/>
1721
<img
1822
className={styles.yellowColon}
1923
src='/images/svg/yellow-colon.svg'

0 commit comments

Comments
 (0)