From af644708a01404503d246d7abd70f985f40917c0 Mon Sep 17 00:00:00 2001 From: Vivek Kasture Date: Wed, 8 Nov 2023 20:28:56 +0530 Subject: [PATCH] Issue #0001 feat: Added details --- packages/cohort/src/pages/CohortDetails.js | 43 +++++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/packages/cohort/src/pages/CohortDetails.js b/packages/cohort/src/pages/CohortDetails.js index 34d68942..d16bb667 100644 --- a/packages/cohort/src/pages/CohortDetails.js +++ b/packages/cohort/src/pages/CohortDetails.js @@ -10,6 +10,9 @@ import { Heading, HStack, Center, + Button, + ArrowDownIcon, + ArrowUpIcon, } from "native-base"; import { useTranslation } from "react-i18next"; import { @@ -26,6 +29,7 @@ import { import moment from "moment"; import manifest from "../manifest.json"; import { useParams } from "react-router-dom"; +import Collapse from "@mui/material/Collapse"; const colors = overrideColorTheme(); @@ -34,6 +38,7 @@ const CohortDetails = ({ footerLinks, setAlert, appName }) => { const [selfAttendance, setSelfAttendance] = React.useState({}); const [showModal, setShowModal] = React.useState(false); const [cohortDetails, setCohortDetails] = React.useState({}); + const [toggleDetails, setToggleDetails] = React.useState(true); const [fields, setFields] = React.useState([]); const [loading, setLoading] = React.useState(true); let newAvatar = localStorage.getItem("firstName"); @@ -145,7 +150,11 @@ const CohortDetails = ({ footerLinks, setAlert, appName }) => { } }); setFields(fieldVals); - } + }; + + const handleToggleDetails = () => { + setToggleDetails(!toggleDetails); + }; React.useEffect(() => { const getData = async () => { @@ -210,16 +219,30 @@ const CohortDetails = ({ footerLinks, setAlert, appName }) => { > {fields.length && ( - - Details - + - {fields.map((item, index) => { - return - {item.label}: - {item.values} - - })} + + {fields.map((item, index) => { + return ( + + {item.label}: + {item.values} + + ); + })} + )}