11import TextSection from '/components/TextSection.jsx' ;
22import Heading from '/components/Heading' ;
33import { UnderlineTypes } from '../utils/underlineType' ;
4+ import { useRef } from 'react' ;
5+ import InternalTeam from './InternalTeam' ;
6+ import TechnicalTeam from './TechnicalTeam' ;
47
58const MEET_OUR_TEAM = 'flex flex-col bg-pink pt-10 z-0 w-full' ;
69const CONTENT_CONTAINER = 'flex flex-col pt-5 p-5 md:px-32' ;
7- const MEET_OUR_AMAZING_TEAM_TITLE = "flex flex-wrap items-baseline gap-x-2 pt-5 justify-center w-fit mx-20 sm:mx-20 md:mx-auto lg:mx-auto" ;
10+ const MEET_OUR_AMAZING_TEAM_TITLE =
11+ 'flex flex-wrap items-baseline gap-x-2 pt-5 justify-center w-fit mx-20 sm:mx-20 md:mx-auto lg:mx-auto' ;
812
9-
10-
11- const Button = ( { classes = '' , children, targetId, timeout= '' } ) => {
13+ const Button = ( { classes = '' , children, targetRef } ) => {
1214 return (
1315 < button
1416 onClick = { ( ) => {
15- document . querySelector ( `#${ targetId } ` ) . scrollIntoView ( { behavior : 'smooth' } ) ;
16- setTimeout ( ( ) => {
17- window . scrollBy ( { top : - 50 , left : 0 , behavior : 'smooth' } ) ;
18- } , timeout ) ; // Wait for initial scroll to complete
19- } }
17+ if ( targetRef ?. current ) {
18+ const yOffset = - 50 ;
19+ const y = targetRef . current . getBoundingClientRect ( ) . top + window . pageYOffset + yOffset ;
20+
21+ window . scrollTo ( { top : y , behavior : 'smooth' } ) ;
22+ }
23+ } }
2024 className = { `cursor-pointer rounded-full text-white border-white py-2 px-8 bg-brightPink border-4 text-3xl font-bold w-48 ${ classes } ` }
2125 >
2226 { children }
@@ -25,27 +29,47 @@ const Button = ({ classes = '', children, targetId, timeout=''}) => {
2529} ;
2630
2731const MeetOurAmazingTeam = ( ) => {
32+ const internalRef = useRef ( null ) ;
33+ const technicalRef = useRef ( null ) ;
34+
2835 return (
2936 < div >
3037 < div className = { MEET_OUR_TEAM } >
3138 < div className = { MEET_OUR_AMAZING_TEAM_TITLE } >
32- < h1 className = 'text-5xl font-semibold' > Meet our</ h1 >
33- < Heading underlineType = { UnderlineTypes . PINK_UNDERLINE } > < i > Amazing </ i > </ Heading >
34- < h1 className = 'text-5xl font-semibold ml-2' > Team</ h1 >
39+ < h1 className = "text-5xl font-semibold" > Meet our</ h1 >
40+ < Heading
41+ distanceFromTop = { 13 }
42+ classes = "italic whitespace-nowrap"
43+ underlineType = { UnderlineTypes . PINK_UNDERLINE }
44+ >
45+ Amazing
46+ </ Heading >
47+ < h1 className = "text-5xl font-semibold ml-2" > Team</ h1 >
3548 </ div >
3649 < div className = { CONTENT_CONTAINER } >
3750 < TextSection classes = "text-black pb-10 w-fit justify-center text-center mx-10 sm:mx-20 md:mx-auto lg:mx-auto" >
38- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
39- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
40- ex ea commodo consequat.
51+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
52+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
53+ ea commodo consequat.
4154 </ TextSection >
42- < div className = "pt-5 pb-12 flex justify-center gap-6 mx-auto flex-col sm:flex-col md-flex-row lg:flex-row" >
43- < Button targetId = "internal" timeout = '500' > Internal</ Button >
44- < Button targetId = "technical" timeout = '1000' > Technical</ Button >
55+ < div className = "pt-5 pb-12 flex justify-center gap-6 mx-auto flex-col sm:flex-row" >
56+ < Button targetRef = { internalRef } timeout = { 500 } >
57+ Internal
58+ </ Button >
59+ < Button targetRef = { technicalRef } timeout = { 1000 } >
60+ Technical
61+ </ Button >
4562 </ div >
4663 </ div >
4764 </ div >
48- </ div >
65+
66+ < section id = "internal" ref = { internalRef } className = "h-screen p-12" >
67+ < InternalTeam />
68+ </ section >
69+ < section id = "technical" ref = { technicalRef } className = "h-screen p-12 bg-[#bcfbe4]" >
70+ < TechnicalTeam />
71+ </ section >
72+ </ div >
4973 ) ;
5074} ;
5175
0 commit comments