diff --git a/frontend/public/images/founder.jpeg b/frontend/public/images/founder.jpeg new file mode 100644 index 00000000..be952f8b Binary files /dev/null and b/frontend/public/images/founder.jpeg differ diff --git a/frontend/src/pages/About/About.jsx b/frontend/src/pages/About/About.jsx index b7972da9..ab578cd6 100644 --- a/frontend/src/pages/About/About.jsx +++ b/frontend/src/pages/About/About.jsx @@ -1,12 +1,14 @@ -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"; +import Loader from "../../components/util/Loader"; +import { SimpleToast } from "../../components/util/Toast/Toast"; const useStyles = makeStyles(() => ({ details: { @@ -20,6 +22,65 @@ const useStyles = makeStyles(() => ({ export const About = (props) => { let dark = props.theme; + const [team, setTeam] = useState([]); + const [image, setImage] = useState([]); + const [toast, setToast] = useState({ + toastStatus: false, + toastType: "", + toastMessage: "", + }); + const [isLoaded, setIsLoaded] = useState(false); + useEffect(() => { + getTeam(); + }, []); + const getTeam = async () => { + setIsLoaded(true); + 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(","), + }; + }); + let _image = []; + await _data?.map((item) => { + let formattedPath = item.image?.replace(/\\/g, "/"); + if (formattedPath?.startsWith("uploads/")) { + formattedPath = formattedPath.replace("uploads/", ""); + if (formattedPath) { + formattedPath = `${END_POINT}/${formattedPath}`; + } + } + _image.push({ image: formattedPath, id: item._id }); + }); + setTeam(_data); + setImage(_image); + setToast({ + ...toast, + toastMessage: "Successfully get Board Members", + toastStatus: true, + toastType: "success", + }); + } catch (error) { + console.error(error); + setToast({ + ...toast, + toastMessage: "Sorry! Unable to Board Members", + toastStatus: true, + toastType: "error", + }); + } + setIsLoaded(false); + }; + const handleCloseToast = (event, reason) => { + if (reason === "clickaway") { + return; + } + setToast({ ...toast, toastStatus: false }); + }; const classes = useStyles(); return ( @@ -98,80 +159,61 @@ export const About = (props) => { } >
{roleObject.description}
-{"I am a Software Developer who ❤ contributing to open source"}
+{roleObject?.description}
{roleObject.description}
-