1- import React from "react" ;
1+ import React , { useState , useEffect } from "react" ;
2+ import { PopupModal } from "react-calendly" ;
23import SocialProfiles from "../components/SocialProfiles" ;
3- import { socialLinks } from "../constants" ;
4+ import { socialLinks , calendlyUrl , userEmail } from "../constants" ;
5+ import {
6+ trackCalendlyOpen ,
7+ trackCalendlyClose ,
8+ trackEmailClick ,
9+ setupCalendlyEventListeners ,
10+ } from "../utils/calendly" ;
411
512const Socials = ( ) => {
13+ const [ isCalendlyOpen , setIsCalendlyOpen ] = useState ( false ) ;
14+
15+ useEffect ( ( ) => {
16+ // Setup Calendly event listeners for tracking
17+ setupCalendlyEventListeners ( ) ;
18+ } , [ ] ) ;
19+
20+ const handleScheduleClick = ( ) => {
21+ setIsCalendlyOpen ( true ) ;
22+ trackCalendlyOpen ( ) ;
23+ } ;
24+
25+ const handleCalendlyClose = ( ) => {
26+ setIsCalendlyOpen ( false ) ;
27+ trackCalendlyClose ( ) ;
28+ } ;
29+
30+ const handleEmailClick = ( ) => {
31+ trackEmailClick ( ) ;
32+ window . location . href = `mailto:${ userEmail } ` ;
33+ } ;
34+
635 return (
736 < section
837 className = "gap-16 w-5/6 max-container mx-auto px-4 relative"
@@ -53,8 +82,13 @@ const Socials = () => {
5382 { /* Contact CTA */ }
5483 < div className = "text-center space-y-6" >
5584 < div className = "flex flex-wrap justify-center gap-4" >
56- < button className = "glow-button" > Send Email</ button >
57- < button className = "px-6 py-3 rounded-lg border border-border text-text-secondary hover:text-text-primary hover:border-primary-400 transition-all duration-300 bg-surface/30 backdrop-blur-sm" >
85+ < button className = "glow-button" onClick = { handleEmailClick } >
86+ Send Email
87+ </ button >
88+ < button
89+ className = "px-6 py-3 rounded-lg border border-border text-text-secondary hover:text-text-primary hover:border-primary-400 transition-all duration-300 bg-surface/30 backdrop-blur-sm"
90+ onClick = { handleScheduleClick }
91+ >
5892 Schedule Call
5993 </ button >
6094 </ div >
@@ -63,6 +97,21 @@ const Socials = () => {
6397 </ p >
6498 </ div >
6599 </ div >
100+
101+ { /* Calendly Popup Modal */ }
102+ < PopupModal
103+ url = { calendlyUrl }
104+ onModalClose = { handleCalendlyClose }
105+ open = { isCalendlyOpen }
106+ rootElement = { document . getElementById ( "root" ) }
107+ pageSettings = { {
108+ backgroundColor : "111113" ,
109+ hideEventTypeDetails : false ,
110+ hideLandingPageDetails : false ,
111+ primaryColor : "8b5cf6" ,
112+ textColor : "ffffff" ,
113+ } }
114+ />
66115 </ section >
67116 ) ;
68117} ;
0 commit comments