@@ -7,6 +7,7 @@ import { useNavigate } from "react-router";
77const TeamSlider = ( ) => {
88 const [ currentSlideIndex , setCurrentSlideIndex ] = useState ( 0 ) ;
99 const [ cardsPerView , setCardsPerView ] = useState ( 1 ) ;
10+ const [ activeTeam , setActiveTeam ] = useState ( "All" ) ;
1011 const navigate = useNavigate ( ) ;
1112
1213 useEffect ( ( ) => {
@@ -34,7 +35,20 @@ const TeamSlider = () => {
3435 new Map ( teamMembers . map ( ( member ) => [ member . name , member ] ) ) . values ( ) ,
3536 ) ;
3637
37- const maxSlideIndex = Math . max ( 0 , uniqueTeamMembers . length - cardsPerView ) ;
38+ const teams = [
39+ "All" ,
40+ "Executive Body" ,
41+ "Team Bluebird" ,
42+ "Team Bluestreak" ,
43+ "Team Blueprint" ,
44+ ] ;
45+
46+ const filteredTeamMembers =
47+ activeTeam === "All"
48+ ? uniqueTeamMembers
49+ : uniqueTeamMembers . filter ( ( member ) => member . team === activeTeam ) ;
50+
51+ const maxSlideIndex = Math . max ( 0 , filteredTeamMembers . length - cardsPerView ) ;
3852
3953 const showNextMembers = ( ) => {
4054 setCurrentSlideIndex ( ( currentIndex ) => {
@@ -68,13 +82,31 @@ const TeamSlider = () => {
6882 < section className = "bg-[#00163A] text-white px-4 sm:px-6 py-16" >
6983 < div className = "max-w-7xl mx-auto" >
7084 < div className = "mb-10" >
71- < h2 className = "text-3xl font-bold mb-2 ml-12" > Our team</ h2 >
72- < p className = "text-xl text-gray-300 ml-12" >
85+ < h2 className = "text-3xl font-bold mb-2 ml-4 sm:ml- 12" > Our team</ h2 >
86+ < p className = "text-xl text-gray-300 ml-4 sm:ml- 12" >
7387 Meet Our Amazing Team Members
7488 </ p >
89+
90+ { /* Team Filter Buttons */ }
91+ < div className = "flex justify-start flex-wrap gap-2 sm:gap-4 mt-6 mb-6 ml-4 sm:ml-12" >
92+ { teams . map ( ( team ) => (
93+ < button
94+ key = { team }
95+ onClick = { ( ) => setActiveTeam ( team ) }
96+ className = { `px-2 py-1 sm:px-4 sm:py-2 rounded-full border text-sm sm:text-lg font-medium transition cursor-pointer hover:bg-white hover:text-[#00163A] ${
97+ activeTeam === team
98+ ? "bg-white text-[#00163A]"
99+ : "bg-transparent text-white border-white"
100+ } `}
101+ >
102+ { team }
103+ </ button >
104+ ) ) }
105+ </ div >
106+
75107 < button
76108 onClick = { viewFullTeam }
77- className = "mt-4 border border-white text-white py-2 px-4 ml-12 rounded hover:bg-white hover:text-[#00163A] transition-all duration-300 cursor-pointer"
109+ className = "mt-4 border border-white text-white py-2 px-4 ml-4 sm:ml- 12 rounded hover:bg-white hover:text-[#00163A] transition-all duration-300 cursor-pointer"
78110 >
79111 View all team members
80112 </ button >
@@ -96,7 +128,7 @@ const TeamSlider = () => {
96128 transform : `translateX(-${ currentSlideIndex * ( 100 / cardsPerView ) } %)` ,
97129 } }
98130 >
99- { uniqueTeamMembers . map ( ( teamMember , memberIndex ) => (
131+ { filteredTeamMembers . map ( ( teamMember , memberIndex ) => (
100132 < div
101133 key = { `team-member-${ memberIndex } ` }
102134 className = "flex-shrink-0 px-2"
@@ -167,12 +199,14 @@ const TeamSlider = () => {
167199 </ div >
168200
169201 < div className = "mt-16" >
170- < h3 className = "text-xl font-bold mb-1 ml-12" > Join Us Today!</ h3 >
171- < p className = "text-base text-gray-300 mb-3 ml-12" >
202+ < h3 className = "text-xl font-bold mb-1 ml-4 sm:ml-12" >
203+ Join Us Today!
204+ </ h3 >
205+ < p className = "text-base text-gray-300 mb-3 ml-4 sm:ml-12" >
172206 Ready to be part of our amazing team? We're always looking for
173207 talented individuals who share our passion.
174208 </ p >
175- < button className = "border border-white text-white py-2 px-4 ml-12 rounded hover:bg-white hover:text-[#00163A] transition-all duration-300 cursor-pointer" >
209+ < button className = "border border-white text-white py-2 px-4 ml-4 sm:ml- 12 rounded hover:bg-white hover:text-[#00163A] transition-all duration-300 cursor-pointer" >
176210 Apply here
177211 </ button >
178212 </ div >
0 commit comments