Skip to content

Commit a691102

Browse files
author
Abigia Debebe
committed
technical team data fetched from contentful placeholders
1 parent a96f85b commit a691102

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

components/TechnicalTeam.jsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,18 @@ import { UnderlineTypes } from '../utils/underlineType';
77

88
const TechnicalTeam = () => {
99
const [executives, setExecutives] = useState([]);
10-
const [positions, setPositions] = useState([]);
10+
const [projects, setProjects] = useState([]);
1111
const [activeTab, setActiveTab] = useState('');
1212

1313
useEffect(() => {
14-
fetchContent('adminTeamMember').then((data) => {
14+
fetchContent('technicalTeam').then((data) => {
1515
setExecutives(data);
1616

17-
const uniquePositions = data
18-
.map((exec) => exec.position)
19-
.filter((pos, index, self) => self.indexOf(pos) === index);
20-
setPositions(uniquePositions);
17+
const uniqueProjects = data.map((exec) => exec.project).filter((pos, index, self) => self.indexOf(pos) === index);
18+
setProjects(uniqueProjects);
2119

22-
if (uniquePositions.length > 0) {
23-
setActiveTab(uniquePositions[0]);
20+
if (uniqueProjects.length > 0) {
21+
setActiveTab(uniqueProjects[0]);
2422
}
2523
});
2624
}, []);
@@ -31,19 +29,19 @@ const TechnicalTeam = () => {
3129
<Heading underlineType={UnderlineTypes.PURPLE_SHORT_UNDERLINE}>Technical Team</Heading>
3230
</div>
3331
<div>
34-
{positions.length > 0 && (
32+
{projects.length > 0 && (
3533
<Tabs value={activeTab} onChange={(val) => setActiveTab(val)}>
36-
<TabsHeader className="flex justify-items-center">
37-
{positions.map((position) => (
38-
<Tab className="team-tab rounded-full p-1 font-medium" key={position} value={position}>
39-
{position}
34+
<TabsHeader className="flex flex-row justify-center">
35+
{projects.map((project) => (
36+
<Tab className="team-tab rounded-full p-1 font-medium" key={project} value={project}>
37+
{project}
4038
</Tab>
4139
))}
4240
</TabsHeader>
4341
<TabsBody>
44-
{positions.map((position) => (
45-
<TabPanel key={position} value={position}>
46-
<Team executives={executives.filter((exec) => exec.position === position)} />
42+
{projects.map((project) => (
43+
<TabPanel key={project} value={project}>
44+
<Team executives={executives.filter((exec) => exec.project === project)} />
4745
</TabPanel>
4846
))}
4947
</TabsBody>

0 commit comments

Comments
 (0)