@@ -17,8 +17,8 @@ const ProfileSkeleton = () => {
1717const Teams = ( ) => {
1818 const [ fetched , setFetched ] = useState ( false ) ;
1919 const [ convenor , setConvenor ] = useState ( null ) ;
20- const [ president , setPresident ] = useState ( null ) ;
21- const [ vp , setVp ] = useState ( null ) ;
20+ const [ president , setPresident ] = useState ( [ ] ) ;
21+ const [ vp , setVp ] = useState ( [ ] ) ;
2222
2323 // const [admins, setAdmins] = useState([]);
2424 const [ directors , setDirectors ] = useState ( [ ] ) ;
@@ -43,11 +43,11 @@ const Teams = () => {
4343 const convenorData = teamData . find (
4444 ( item ) => item . position === "Convenor"
4545 ) ;
46- const presidentData = teamData . find (
46+ const presidentData = teamData . filter (
4747 ( item ) => item . position === "President"
4848 ) ;
49- const vpData = teamData . find (
50- ( item ) => item . position === "vicePresident "
49+ const vpData = teamData . filter (
50+ ( item ) => item . position === "Vice President "
5151 ) ;
5252
5353 console . log ( "Convenor:" , convenorData ) ;
@@ -107,8 +107,8 @@ const Teams = () => {
107107 const generateKeywords = ( ) => {
108108 const keywordsArray = [
109109 convenor ?. name || "" ,
110- president ?. name || "" ,
111- vp ?. name || "" ,
110+ president . length > 0 ? president . map ( p => p . name ) . join ( ", " ) : "" ,
111+ vp . length > 0 ? vp . map ( v => v . name ) . join ( ", " ) : "" ,
112112 directors . length > 0 ? directors . map ( director => director . name ) . join ( ", " ) : "" ,
113113 leads . length > 0 ? leads . map ( lead => lead . name ) . join ( ", " ) : "" ,
114114 associates . length > 0 ? associates . map ( associate => associate . name ) . join ( ", " ) : "" ,
@@ -173,16 +173,22 @@ const Teams = () => {
173173 "employee" : [
174174 {
175175 "@type" : "Person" ,
176- "name" : president ?. name ,
177- "jobTitle" : "President " ,
178- "image" : president ?. pictureUrl ,
176+ "name" : convenor ?. name ,
177+ "jobTitle" : "Convenor " ,
178+ "image" : convenor ?. pictureUrl ,
179179 } ,
180- {
180+ ...president . map ( p => ( {
181+ "@type" : "Person" ,
182+ "name" : p . name ,
183+ "jobTitle" : "President" ,
184+ "image" : p . pictureUrl ,
185+ } ) ) ,
186+ ...vp . map ( v => ( {
181187 "@type" : "Person" ,
182- "name" : vp ? .name ,
188+ "name" : v . name ,
183189 "jobTitle" : "Vice President" ,
184- "image" : vp ? .pictureUrl ,
185- } ,
190+ "image" : v . pictureUrl ,
191+ } ) ) ,
186192 ...leads . map ( lead => ( {
187193 "@type" : "Person" ,
188194 "name" : lead . name ,
@@ -233,14 +239,22 @@ const Teams = () => {
233239 President
234240 </ h2 >
235241 { ! fetched ? (
236- < ProfileSkeleton />
237- ) : president ? (
238- < ProfileCard
239- photo = { president . pictureUrl }
240- name = { president . name }
241- caption = { president . caption }
242- socials = { president . socials }
243- />
242+ < div className = "flex gap-8" >
243+ < ProfileSkeleton />
244+ < ProfileSkeleton />
245+ </ div >
246+ ) : president . length > 0 ? (
247+ < div className = "flex flex-wrap justify-center gap-8" >
248+ { president . map ( ( pres , index ) => (
249+ < ProfileCard
250+ key = { index }
251+ photo = { pres . pictureUrl }
252+ name = { pres . name }
253+ caption = { pres . caption }
254+ socials = { pres . socials }
255+ />
256+ ) ) }
257+ </ div >
244258 ) : (
245259 < p className = "text-center text-gray-400" > No president data available</ p >
246260 ) }
@@ -251,14 +265,22 @@ const Teams = () => {
251265 Vice President
252266 </ h2 >
253267 { ! fetched ? (
254- < ProfileSkeleton />
255- ) : vp ? (
256- < ProfileCard
257- photo = { vp . pictureUrl }
258- name = { vp . name }
259- caption = { vp . caption }
260- socials = { vp . socials }
261- />
268+ < div className = "flex gap-8" >
269+ < ProfileSkeleton />
270+ < ProfileSkeleton />
271+ </ div >
272+ ) : vp . length > 0 ? (
273+ < div className = "flex flex-wrap justify-center gap-8" >
274+ { vp . map ( ( vice , index ) => (
275+ < ProfileCard
276+ key = { index }
277+ photo = { vice . pictureUrl }
278+ name = { vice . name }
279+ caption = { vice . caption }
280+ socials = { vice . socials }
281+ />
282+ ) ) }
283+ </ div >
262284 ) : (
263285 < p className = "text-center text-gray-400" > No vice president data available</ p >
264286 ) }
0 commit comments