11import { useState } from "react" ;
22import { toast } from "@/components/ui/use-toast" ;
3+ import { personalInfo } from "@/data/personalInfo" ;
34
45const GetInTouchSection = ( ) => {
56 const [ form , setForm ] = useState ( { name : "" , company : "" , email : "" , message : "" } ) ;
@@ -43,7 +44,7 @@ const GetInTouchSection = () => {
4344 form . message ,
4445 ] . join ( "\n" )
4546 ) ;
46- window . location . href = `mailto:baoyifei@bu.edu ?subject=${ subject } &body=${ body } ` ;
47+ window . location . href = `mailto:${ personalInfo . email } ?subject=${ subject } &body=${ body } ` ;
4748 setSubmitting ( false ) ;
4849 } ;
4950
@@ -110,10 +111,11 @@ const GetInTouchSection = () => {
110111 < form onSubmit = { handleSubmit } >
111112 < div className = "grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3" >
112113 < div >
113- < label style = { labelStyle } >
114+ < label htmlFor = "contact-name" style = { labelStyle } >
114115 name < span style = { { color : "var(--term-red)" } } > *</ span >
115116 </ label >
116117 < input
118+ id = "contact-name"
117119 placeholder = "your name"
118120 value = { form . name }
119121 onChange = { ( e ) => setForm ( { ...form , name : e . target . value } ) }
@@ -123,11 +125,12 @@ const GetInTouchSection = () => {
123125 />
124126 </ div >
125127 < div >
126- < label style = { labelStyle } >
128+ < label htmlFor = "contact-company" style = { labelStyle } >
127129 company{ " " }
128130 < span style = { { color : "var(--term-dim)" , fontSize : "10px" } } > (optional)</ span >
129131 </ label >
130132 < input
133+ id = "contact-company"
131134 placeholder = "company name"
132135 value = { form . company }
133136 onChange = { ( e ) => setForm ( { ...form , company : e . target . value } ) }
@@ -139,10 +142,11 @@ const GetInTouchSection = () => {
139142 </ div >
140143
141144 < div style = { { marginBottom : "12px" } } >
142- < label style = { labelStyle } >
145+ < label htmlFor = "contact-email" style = { labelStyle } >
143146 email < span style = { { color : "var(--term-red)" } } > *</ span >
144147 </ label >
145148 < input
149+ id = "contact-email"
146150 type = "email"
147151 placeholder = "you@example.com"
148152 value = { form . email }
@@ -154,10 +158,11 @@ const GetInTouchSection = () => {
154158 </ div >
155159
156160 < div style = { { marginBottom : "16px" } } >
157- < label style = { labelStyle } >
161+ < label htmlFor = "contact-message" style = { labelStyle } >
158162 message < span style = { { color : "var(--term-red)" } } > *</ span >
159163 </ label >
160164 < textarea
165+ id = "contact-message"
161166 placeholder = "your message..."
162167 rows = { 5 }
163168 value = { form . message }
@@ -210,9 +215,9 @@ const GetInTouchSection = () => {
210215
211216 < div style = { { fontSize : "12px" } } >
212217 { [
213- { key : "email" , value : "baoyifei@bu.edu" , href : " mailto:baoyifei@bu.edu" } ,
214- { key : "phone" , value : "+1 857 340 3064" , href : " tel:+18573403064" } ,
215- { key : "location" , value : "Boston, MA" , href : null } ,
218+ { key : "email" , value : personalInfo . email , href : ` mailto:${ personalInfo . email } ` } ,
219+ { key : "phone" , value : personalInfo . phone , href : ` tel:${ personalInfo . phone . replace ( / \s / g , "" ) } ` } ,
220+ { key : "location" , value : personalInfo . location , href : null } ,
216221 ] . map ( ( { key, value, href } ) => (
217222 < div
218223 key = { key }
@@ -231,9 +236,8 @@ const GetInTouchSection = () => {
231236 { href ? (
232237 < a
233238 href = { href }
234- style = { { color : "var(--term-text)" , textDecoration : "none" } }
235- onMouseEnter = { ( e ) => ( e . currentTarget . style . color = "var(--term-green)" ) }
236- onMouseLeave = { ( e ) => ( e . currentTarget . style . color = "var(--term-text)" ) }
239+ className = "contact-link"
240+ style = { { color : "var(--term-text)" , textDecoration : "none" , transition : "color 0.15s" } }
237241 >
238242 { value }
239243 </ a >
0 commit comments