Skip to content

Commit b70ff86

Browse files
committed
Finished presidents section, mobile view WIP.
1 parent b5e603b commit b70ff86

File tree

3 files changed

+107
-27
lines changed

3 files changed

+107
-27
lines changed

components/AlumniSection.jsx

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Heading from './Heading';
66
import { UnderlineTypes } from '../utils/underlineType';
77
import CoPresident from "./CoPresident";
88

9+
// Dummy values to be replaced with contentful
910
const people = [{
1011
name: "John Doe",
1112
linkedin: "randomlink.com",
@@ -105,6 +106,48 @@ const people = [{
105106
},
106107
classes: "text-white",
107108
},
109+
{
110+
name: "John Doe",
111+
linkedin: "randomlink.com",
112+
position: "Dev",
113+
project: "Finance",
114+
pfp: {
115+
fields: {
116+
file: {
117+
url: "//t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
118+
}
119+
}
120+
},
121+
classes: "text-white",
122+
},
123+
{
124+
name: "John Doe",
125+
linkedin: "randomlink.com",
126+
position: "Dev",
127+
project: "Marketing",
128+
pfp: {
129+
fields: {
130+
file: {
131+
url: "//t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
132+
}
133+
}
134+
},
135+
classes: "text-white",
136+
},
137+
{
138+
name: "John Doe",
139+
linkedin: "randomlink.com",
140+
position: "Dev",
141+
project: "Tech",
142+
pfp: {
143+
fields: {
144+
file: {
145+
url: "//t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
146+
}
147+
}
148+
},
149+
classes: "text-white",
150+
},
108151
];
109152

110153
const TechnicalTeam = () => {
@@ -113,29 +156,32 @@ const TechnicalTeam = () => {
113156
const [activeTab, setActiveTab] = useState('');
114157

115158
useEffect(() => {
116-
fetchContent('technicalTeam').then((data) => {
159+
// Put Contenful stuff here
160+
fetchContent('technicalTeam').then(() => {
117161
setExecutives(people);
118162

119-
const uniqueProjects = data.map((exec) => exec.project).filter((pos, index, self) => self.indexOf(pos) === index);
120163
setProjects(["Presidents", "Events", "Finance", "Marketing", "Tech"]);
121164

122-
if (uniqueProjects.length > 0) {
123-
setActiveTab(uniqueProjects[0]);
124-
}
165+
setActiveTab("Presidents");
125166
});
126167
}, []);
127168

128169
return (
129-
<section className="bg-[#7055FD] p-12 h-screen">
170+
<section className="bg-[#7055FD] p-12 md:min-h-screen h-full">
130171
<div className="mb-9">
131172
<Heading underlineType={UnderlineTypes.GREEN_SHORT_UNDERLINE} classes={"text-white"}>Alumni</Heading>
132173
</div>
133174
<div>
134175
{projects.length > 0 && (
135-
<Tabs value={activeTab} onChange={(val) => setActiveTab(val)}>
176+
<Tabs
177+
value={activeTab}>
136178
<TabsHeader className="flex flex-row justify-center">
137179
{projects.map((project) => (
138-
<Tab className="alumni-tab rounded-full p-1 font-medium" key={project} value={project}>
180+
<Tab className={`alumni-tab rounded-full p-1 font-medium text-white ${
181+
activeTab === project
182+
? 'bg-[#00D3A9]'
183+
: ''
184+
}`} key={project} value={project} onClick={() => setActiveTab(project)}>
139185
{project}
140186
</Tab>
141187
))}

components/CoPresident.jsx

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ import Carousel from './Carousel';
44
import 'swiper/css';
55
import 'swiper/css/navigation';
66
import Avatar from './Avatar';
7-
const CAROUSEL_CONTAINER = 'text-white rounded-lg w-[20rem] h-[30rem] shadow-2xl md:w-4/5 swiper-button-white';
8-
const ALUMNI_TILE =
9-
'bg-[#A689FF] bg-opacity-50 w-[20rem] h-[70rem] md:h-[30rem] rounded-lg items-center p-14 lg:p-10 flex flex-col shadow-2xl md:w-full md:flex-row';
7+
const CAROUSEL_CONTAINER = 'president-carousel text-white rounded-lg w-[20rem] h-full md:w-4/5 swiper-button-white flex justify-center items-center';
8+
const PRESIDENT_TILE =
9+
'bg-[#A689FF] bg-opacity-50 w-[20rem] h-[70rem] md:h-[20rem] rounded-lg items-center p-14 lg:p-10 flex flex-col md:w-4/5 md:flex-row';
1010

11-
const President = [{
12-
name: "Nathan Pham",
11+
12+
13+
const President = [[{
14+
name: "Jane Doe",
1315
position: "Co-Pres",
16+
year: "2025",
1417
previousRole: "Events team",
1518
testimonial: "Wow I love this club",
1619
linkedin: "random link",
@@ -22,12 +25,29 @@ const President = [{
2225
}
2326
},
2427
classes: "text-[#7055FD]",
25-
}];
28+
},
29+
{
30+
name: "John Doe",
31+
position: "Co-Pres",
32+
year: "2025",
33+
previousRole: "Events team",
34+
testimonial: "Vitae eget venenatis rhoncus aliquet curabitur mauris, sed turpis nulla. Neque molestie mi placerat ultrices sit in sit.",
35+
linkedin: "random link",
36+
pfp: {
37+
fields: {
38+
file: {
39+
url: "//t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
40+
}
41+
}
42+
},
43+
classes: "text-[#7055FD]",
44+
}
45+
]];
2646

27-
const AlumniTile = ({ name, linkedin, pfp, classes, testimonial }) => {
47+
const PresidentTile = ({ name, linkedin, pfp, classes, testimonial, position }) => {
2848
return (
29-
<div className={ALUMNI_TILE}>
30-
<Avatar key={name} {...{name, linkedin, pfp, classes}}></Avatar>
49+
<div className={PRESIDENT_TILE}>
50+
<Avatar key={name} {...{name, linkedin, pfp, classes, position}}></Avatar>
3151
<p className="text-[1.1rem] font-light italic leading-7 mx-auto md:ml-14 md:mb-24 md:text-[1.3rem] lg:text-[1.5rem] md:p-10 text-[#000000]">
3252
<span className="text-[2rem] font-extrabold">&quot;</span>
3353
{testimonial}
@@ -39,16 +59,18 @@ const AlumniTile = ({ name, linkedin, pfp, classes, testimonial }) => {
3959

4060
const CoPresident = () => {
4161
return (
42-
<div className='bg-white w-full h-[40rem] flex justify-center items-center'>
43-
<div className={CAROUSEL_CONTAINER}>
44-
<Carousel>
45-
{President.map((president) => (
46-
<SwiperSlide key={president.name}>
47-
<AlumniTile {...president} />
48-
</SwiperSlide>
49-
))}
50-
</Carousel>
51-
</div>
62+
<div className={CAROUSEL_CONTAINER}>
63+
<Carousel>
64+
{President.map((president) => (
65+
<SwiperSlide key={president[0].name}>
66+
<div className='bg-white w-full rounded-3xl h-full flex flex-col justify-center items-center gap-10 py-20'>
67+
<div className='text-[#000000] text-4xl absolute top-5 left-32'>{president[0].year}</div>
68+
<PresidentTile {...president[0]} />
69+
<PresidentTile {...president[1]} />
70+
</div>
71+
</SwiperSlide>
72+
))}
73+
</Carousel>
5274
</div>
5375
);
5476
};

styles/globals.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@
3838
.technical-section {
3939
background-color: #bcfbe4;
4040
}
41+
42+
.president-carousel {
43+
position: relative;
44+
}
45+
46+
.president-carousel .swiper-button-next {
47+
right: 0px;
48+
}
49+
50+
.president-carousel .swiper-button-prev {
51+
left: 0px;
52+
}

0 commit comments

Comments
 (0)