From f1110f07b7d767a776ad896b996843ee48145a21 Mon Sep 17 00:00:00 2001 From: mbalsdon Date: Wed, 30 Mar 2022 01:19:55 -0700 Subject: [PATCH] add functionality to modal; change styling --- .../meeting-details-components/Body.tsx | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/components/meeting-details/meeting-details-components/Body.tsx b/src/components/meeting-details/meeting-details-components/Body.tsx index 3eb9062..09a1be0 100644 --- a/src/components/meeting-details/meeting-details-components/Body.tsx +++ b/src/components/meeting-details/meeting-details-components/Body.tsx @@ -1,5 +1,6 @@ import { Box, + Divider, List, ListItem, ListItemIcon, @@ -11,7 +12,6 @@ import PersonOutlineIcon from "@mui/icons-material/PersonOutline"; import DetailedMeeting from "../../../api-bodies/DetailedMeeting"; import { useAppSelector } from "../../../redux/hooks"; import { selectUsers } from "../../../redux/slices/usersSlice"; -import { getMeetingStatus } from "../Utils"; import UserLite from "../../../api-bodies/UserLite"; interface Props { @@ -22,6 +22,27 @@ const Body: React.FC = (props) => { const registrants: UserLite[] = useAppSelector((state) => selectUsers(state, props.meeting.registrantIds) ); + const liveParticipants: UserLite[] = useAppSelector((state) => + selectUsers(state, props.meeting.liveParticipantIds) + ); + + const parseIsoString = (s: string) => { + const month = ["January", "February", "March", "April", + "May", "June", "July", "August", + "September", "October", "November", "December"][parseInt(s.slice(5,7)) - 1]; + const day = s.slice(8, 10); + const isoTime: string = s.slice(11, 16); + const hour: number = parseInt(isoTime.slice(0, 2)); + const hourMod: string = hour % 12 == 0 ? "12" : (hour % 12).toString(); + return month + " " + day + ", " + hourMod + ":" + isoTime.slice(3, 5) + (hour > 11 ? "PM" : "AM"); + }; + + const start = props.meeting.start; + const startDateString = parseIsoString(start); + const listLiveParticipants = () => { + const s: string[] = liveParticipants.map((user) => user.name + ", "); + return s.join("").slice(0, -2); + }; return ( = (props) => { flexDirection: "column", width: "70%", height: "100%", + mt: 10 }} > - Feb 10, 2022 10:45 am - 11:00 am - Status: {getMeetingStatus(props.meeting)} - - Topic: Lorem Ipsum is simply dummy text of the printing and - typesetting industry. Lorem Ipsum has been the industrys standard - dummy text ever since the 1500s. Topic: Lorem Ipsum is simply dummy - text of the printing and typesetting industry. Lorem Ipsum has been - the industrys standard dummy text ever since the 1500s. - + Meeting ID: {props.meeting.meetingId} + {props.meeting.topic} + + Start: {startDateString} + Duration: {props.meeting.duration.toString() + " minutes"} + + Currently inside: {listLiveParticipants()}