diff --git a/frontend/src/pages/About/About.jsx b/frontend/src/pages/About/About.jsx index b7972da9..f9d16f6e 100644 --- a/frontend/src/pages/About/About.jsx +++ b/frontend/src/pages/About/About.jsx @@ -1,12 +1,12 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import { makeStyles } from "@material-ui/core/styles"; import CardContent from "@material-ui/core/CardContent"; import Typography from "@material-ui/core/Typography"; import { MDBBadge } from "mdbreact"; import teamData from "../../test_data/team-roles.json"; - import style from "./about.module.scss"; import "./about.scss"; +import { END_POINT } from "../../config/api"; const useStyles = makeStyles(() => ({ details: { @@ -20,6 +20,26 @@ const useStyles = makeStyles(() => ({ export const About = (props) => { let dark = props.theme; + const [team, setTeam] = useState([]); + useEffect(() => { + getTeam(); + }, []); + const getTeam = async () => { + try { + const url = `${END_POINT}/teamMember/getTeamMembers/`; + const response = await fetch(url); + const data = await response.json(); + const _data = data.map((item) => { + return { + ...item, + teams: item.teams[0].split(","), + }; + }); + setTeam(_data); + } catch (error) { + console.error(error); + } + }; const classes = useStyles(); return ( @@ -188,11 +208,10 @@ export const About = (props) => { } >
{roleObject.description}
+{roleObject?.description}