From 9e2374987a5b5efe1a242166171400ebff69080d Mon Sep 17 00:00:00 2001 From: CodeServer Date: Tue, 29 Mar 2022 23:28:12 +0100 Subject: [PATCH 01/12] open meetings details modal in home --- src/components/home/Meeting.tsx | 8 +++++++- src/components/home/MeetingsPanel.tsx | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/home/Meeting.tsx b/src/components/home/Meeting.tsx index 84128ac..cf71b64 100644 --- a/src/components/home/Meeting.tsx +++ b/src/components/home/Meeting.tsx @@ -1,15 +1,21 @@ import ListItemButton from "@mui/material/ListItemButton"; import ListItemText from "@mui/material/ListItemText"; +import DetailedMeeting from "../../api-bodies/DetailedMeeting"; +import { useAppDispatch } from "../../redux/hooks"; +import { open } from "../../redux/slices/meetingDetailsOpenSlice"; interface Props { + meeting: DetailedMeeting; meetingName: string; meetingTime: string; meetingMembers: string } function Meeting(props: Props) { + const dispatch = useAppDispatch(); + return ( - + dispatch(open(props.meeting))} className="row meeting"> diff --git a/src/components/home/MeetingsPanel.tsx b/src/components/home/MeetingsPanel.tsx index c309745..63d17bc 100644 --- a/src/components/home/MeetingsPanel.tsx +++ b/src/components/home/MeetingsPanel.tsx @@ -62,6 +62,7 @@ const MeetingsPanel: React.FC = () => { if (currentDatemil >= startDatemil && currentDatemil <= endDatemil) { return ( (" " + userLite.name + " ")).toString()} From 63ed20dfb4ade3b46dbac7dda8ef7d8fda07bef0 Mon Sep 17 00:00:00 2001 From: CodeServer Date: Wed, 30 Mar 2022 00:16:16 +0100 Subject: [PATCH 02/12] centered meeting time --- src/components/home/Meeting.tsx | 14 +++++++++++--- src/components/home/MeetingsPanel.tsx | 5 +++++ src/style/App.css | 8 ++++---- src/style/App.css.map | 2 +- src/style/modules/_mainHome.sass | 2 ++ 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/components/home/Meeting.tsx b/src/components/home/Meeting.tsx index cf71b64..24bf854 100644 --- a/src/components/home/Meeting.tsx +++ b/src/components/home/Meeting.tsx @@ -1,11 +1,13 @@ import ListItemButton from "@mui/material/ListItemButton"; import ListItemText from "@mui/material/ListItemText"; import DetailedMeeting from "../../api-bodies/DetailedMeeting"; +import Grid from "@mui/material/Grid"; import { useAppDispatch } from "../../redux/hooks"; import { open } from "../../redux/slices/meetingDetailsOpenSlice"; interface Props { meeting: DetailedMeeting; + meetingClass: string; meetingName: string; meetingTime: string; meetingMembers: string @@ -15,9 +17,15 @@ function Meeting(props: Props) { const dispatch = useAppDispatch(); return ( - dispatch(open(props.meeting))} className="row meeting"> - - + dispatch(open(props.meeting))} className={"row meeting " + props.meetingClass}> + + + + + + + + ); } diff --git a/src/components/home/MeetingsPanel.tsx b/src/components/home/MeetingsPanel.tsx index 63d17bc..d48a0ff 100644 --- a/src/components/home/MeetingsPanel.tsx +++ b/src/components/home/MeetingsPanel.tsx @@ -36,6 +36,8 @@ const MeetingsPanel: React.FC = () => { setInterval(() => setCurrentDate(new Date()), 1000); }, []); + let i = 1; + return (
@@ -60,9 +62,12 @@ const MeetingsPanel: React.FC = () => { const currentDatemil = currentDate.getTime(); if (currentDatemil >= startDatemil && currentDatemil <= endDatemil) { + let lastMeetingClass = meetings.length == i ? " lastMeeting" : ""; + i += 1; return ( (" " + userLite.name + " ")).toString()} diff --git a/src/style/App.css b/src/style/App.css index 6c22cd8..986fb29 100644 --- a/src/style/App.css +++ b/src/style/App.css @@ -33,10 +33,6 @@ a { padding-bottom: 2%; } -.main-home .meetings-panel .meetingEntries::-webkit-scrollbar { - display: none; -} - .main-home .meetings-panel .meeting { background-color: #D3D3D3; text-align: center; @@ -44,6 +40,10 @@ a { line-height: 2; } +.main-home .meetings-panel .lastMeeting { + margin-bottom: 10%; +} + .main-home .short-cuts .row-1 { margin-top: 30vh; } diff --git a/src/style/App.css.map b/src/style/App.css.map index 2035eab..696bf39 100644 --- a/src/style/App.css.map +++ b/src/style/App.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AG8CA,AAAA,WAAW,CAAC;EACR,KAAK,EAA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P,KAAK,CAAC;EACF,YAAY,EAAE,IAAI;EAClB,gBAAgB,EPjDC,OAAO;EOkDxB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,aAAa,EAAE,IAAI;CAIC;;AAxDhC,AAqDY,UArDF,CAqCN,WAAW,CAUP,KAAK,CAMD,KAAK,CAAC;EACF,KAAK,EAAE,KAAK;EACZ,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,GAAG;CAAG;;ACxD9B,AACI,MADE,CACF,eAAe,CAAC;EACZ,WAAW,EAAE,MAAM;EACnB,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,GAAG;EACf,SAAS,EAAE,cAAc;CAqBC;;AA1BlC,AAMQ,MANF,CACF,eAAe,GAKT,CAAC,CAAC;EACA,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,MAAM;CAAG;;AAR7B,AASQ,MATF,CACF,eAAe,CAQX,WAAW,CAAC;EACR,OAAO,EAAE,YAAY;EACrB,UAAU,EAAE,MAAM;EAClB,MAAM,EAAE,IAAI;CAAG;;AAZ3B,AAaQ,MAbF,CACF,eAAe,CAYX,UAAU,CAAE;EACR,MAAM,EAAE,IAAI;EACZ,KAAK,EAAE,GAAG;EACV,gBAAgB,EAAE,OAAO;CAAG;;AAhBxC,AAiBQ,MAjBF,CACF,eAAe,CAgBX,aAAa,CAAC;EACV,OAAO,EAAE,YAAY;EACrB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,IAAI;EACZ,WAAW,EAAE,IAAI;CAAG;;AArBhC,AAsBQ,MAtBF,CACF,eAAe,CAqBX,UAAU,CAAC;EACP,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;CAEQ;;AA1BhC,AAyBY,MAzBN,CACF,eAAe,CAqBX,UAAU,CAGN,CAAC,CAAC;EACE,KAAK,EAAE,IAAI;CAAG", "sources": [ "App.sass", "_variables.sass", diff --git a/src/style/modules/_mainHome.sass b/src/style/modules/_mainHome.sass index e4b6c64..98b644f 100644 --- a/src/style/modules/_mainHome.sass +++ b/src/style/modules/_mainHome.sass @@ -33,6 +33,8 @@ text-align: center margin-top: 15px line-height: 2 + .lastMeeting + margin-bottom: 10% .short-cuts .row-1 margin-top: 30vh From c0d0a8d96cf59a02570bce64ff243a13b49b8664 Mon Sep 17 00:00:00 2001 From: CodeServer Date: Wed, 30 Mar 2022 00:28:21 +0100 Subject: [PATCH 03/12] removed unsupported buttons --- src/components/home/ShortCuts.tsx | 24 ++++++++++++------------ src/style/App.css | 2 +- src/style/App.css.map | 2 +- src/style/modules/_mainHome.sass | 3 ++- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/components/home/ShortCuts.tsx b/src/components/home/ShortCuts.tsx index 98ae56c..8979005 100644 --- a/src/components/home/ShortCuts.tsx +++ b/src/components/home/ShortCuts.tsx @@ -34,19 +34,9 @@ const ShortCuts: React.FC = ({ users }: Props) => { - New Meeting + Schedule Meeting - - - - Join - - - - + + Join + +
); }; diff --git a/src/style/App.css b/src/style/App.css index 986fb29..24fdd0e 100644 --- a/src/style/App.css +++ b/src/style/App.css @@ -45,7 +45,7 @@ a { } .main-home .short-cuts .row-1 { - margin-top: 30vh; + margin-top: 40vh; } .main-home .short-cuts .row-2 { diff --git a/src/style/App.css.map b/src/style/App.css.map index 696bf39..e1734c0 100644 --- a/src/style/App.css.map +++ b/src/style/App.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AG8CA,AAAA,WAAW,CAAC;EACR,KAAK,EAAE,IAAI;CAAG;;AAElB,AAAA,CAAC,CAAC;EACE,eAAe,EAAE,IAAI;CAAG;;AKlD5B,AAAA,UAAU,CAAC;EAGP,SAAS,EAAE,cAAc;CAqDO;;AAxDpC,AAII,UAJM,CAIN,eAAe,CAAC;EACZ,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,IAAI;EAChB,YAAY,EAAE,KAAK;EACnB,YAAY,EPRS,OAAO;EOS5B,YAAY,EAAE,GAAG;EACjB,aAAa,EAAE,IAAI;EACn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AAW,EAAE,MAAM;EACnB,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,GAAG;EACf,SAAS,EAAE,cAAc;CAqBC;;AA1BlC,AAMQ,MANF,CACF,eAAe,GAKT,CAAC,CAAC;EACA,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,MAAM;CAAG;;AAR7B,AASQ,MATF,CACF,eAAe,CAQX,WAAW,CAAC;EACR,OAAO,EAAE,YAAY;EACrB,UAAU,EAAE,MAAM;EAClB,MAAM,EAAE,IAAI;CAAG;;AAZ3B,AAaQ,MAbF,CACF,eAAe,CAYX,UAAU,CAAE;EACR,MAAM,EAAE,IAAI;EACZ,KAAK,EAAE,GAAG;EACV,gBAAgB,EAAE,OAAO;CAAG;;AAhBxC,AAiBQ,MAjBF,CACF,eAAe,CAgBX,aAAa,CAAC;EACV,OAAO,EAAE,YAAY;EACrB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,IAAI;EACZ,WAAW,EAAE,IAAI;CAAG;;AArBhC,AAsBQ,MAtBF,CACF,eAAe,CAqBX,UAAU,CAAC;EACP,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;CAEQ;;AA1BhC,AAyBY,MAzBN,CACF,eAAe,CAqBX,UAAU,CAGN,CAAC,CAAC;EACE,KAAK,EAAE,IAAI;CAAG", "sources": [ "App.sass", "_variables.sass", diff --git a/src/style/modules/_mainHome.sass b/src/style/modules/_mainHome.sass index 98b644f..c66df63 100644 --- a/src/style/modules/_mainHome.sass +++ b/src/style/modules/_mainHome.sass @@ -37,7 +37,8 @@ margin-bottom: 10% .short-cuts .row-1 - margin-top: 30vh + // margin-top: 30vh + margin-top: 40vh .row-2 margin-top: 5vh .mylabel From 612a937df971a87eee5d0928ad60b91dd4b7896e Mon Sep 17 00:00:00 2001 From: mbalsdon Date: Tue, 29 Mar 2022 22:41:56 -0700 Subject: [PATCH 04/12] small changes to obey eslint --- src/components/home/MeetingsPanel.tsx | 5 +++-- src/components/home/ShortCuts.tsx | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/home/MeetingsPanel.tsx b/src/components/home/MeetingsPanel.tsx index d48a0ff..c6fda44 100644 --- a/src/components/home/MeetingsPanel.tsx +++ b/src/components/home/MeetingsPanel.tsx @@ -30,6 +30,7 @@ const MeetingsPanel: React.FC = () => { // ); // participants.push(userLite); // }); + const [currentDate, setCurrentDate] = useState(new Date()); useEffect(() => { @@ -46,7 +47,7 @@ const MeetingsPanel: React.FC = () => {
- + {meetings.map((meeting) => { const meetingMembers: UserLite[] = []; participants.forEach((userLite) => { @@ -62,7 +63,7 @@ const MeetingsPanel: React.FC = () => { const currentDatemil = currentDate.getTime(); if (currentDatemil >= startDatemil && currentDatemil <= endDatemil) { - let lastMeetingClass = meetings.length == i ? " lastMeeting" : ""; + const lastMeetingClass = meetings.length == i ? " lastMeeting" : ""; i += 1; return ( Date: Tue, 29 Mar 2022 22:53:09 -0700 Subject: [PATCH 05/12] homepage styling changes --- src/components/home/Meeting.tsx | 21 ++++++++++----------- src/components/home/MeetingsPanel.tsx | 18 +++++++++++++++--- src/style/App.css | 14 +++++++------- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/components/home/Meeting.tsx b/src/components/home/Meeting.tsx index 24bf854..f908a1e 100644 --- a/src/components/home/Meeting.tsx +++ b/src/components/home/Meeting.tsx @@ -1,9 +1,8 @@ import ListItemButton from "@mui/material/ListItemButton"; -import ListItemText from "@mui/material/ListItemText"; import DetailedMeeting from "../../api-bodies/DetailedMeeting"; -import Grid from "@mui/material/Grid"; import { useAppDispatch } from "../../redux/hooks"; import { open } from "../../redux/slices/meetingDetailsOpenSlice"; +import { Box, Typography } from "@mui/material"; interface Props { meeting: DetailedMeeting; @@ -17,15 +16,15 @@ function Meeting(props: Props) { const dispatch = useAppDispatch(); return ( - dispatch(open(props.meeting))} className={"row meeting " + props.meetingClass}> - - - - - - - - + dispatch(open(props.meeting))} + component="a" + className={"row meeting " + props.meetingClass}> + + {props.meetingName} + {props.meetingTime.toUpperCase()} + {props.meetingMembers} + ); } diff --git a/src/components/home/MeetingsPanel.tsx b/src/components/home/MeetingsPanel.tsx index c6fda44..f93fc15 100644 --- a/src/components/home/MeetingsPanel.tsx +++ b/src/components/home/MeetingsPanel.tsx @@ -42,8 +42,8 @@ const MeetingsPanel: React.FC = () => { return (
- - Meetings in Progress + + Meetings in progress
@@ -62,6 +62,18 @@ const MeetingsPanel: React.FC = () => { const currentDatemil = currentDate.getTime(); + const meetingMembersString = () => { + if (meetingMembers.length > 3) { + return "Participants: " + + meetingMembers[0].name + ", " + + meetingMembers[1].name + ", " + + meetingMembers[2].name + ", and " + + (meetingMembers.length - 3).toString() + " more..."; + } else { + return "Participants: " + meetingMembers.map((userLite) => (" " + userLite.name)).toString(); + } + }; + if (currentDatemil >= startDatemil && currentDatemil <= endDatemil) { const lastMeetingClass = meetings.length == i ? " lastMeeting" : ""; i += 1; @@ -71,7 +83,7 @@ const MeetingsPanel: React.FC = () => { meetingClass={"meeting-" + (i - 1) + lastMeetingClass} meetingName={meeting.topic} meetingTime={formatTimeFromDate(startDate) + " - " + formatTimeFromDate(endDate)} - meetingMembers={meetingMembers.map((userLite) => (" " + userLite.name + " ")).toString()} + meetingMembers={meetingMembersString()} /> ); } diff --git a/src/style/App.css b/src/style/App.css index 24fdd0e..1dd5f3d 100644 --- a/src/style/App.css +++ b/src/style/App.css @@ -11,13 +11,13 @@ a { } .main-home .meetings-panel { - margin: auto; margin-top: 15vh; + padding-bottom: 10vh; border-style: solid; - border-color: #D3D3D3; + border-color: mistyrose; border-width: 2px; border-radius: 40px; - width: 65%; + width: 85%; height: 65vh; overflow: hidden; } @@ -28,14 +28,14 @@ a { .main-home .meetings-panel .panel-label { text-align: center; - background-color: grey; + background-color: #AF000D; padding-top: 2%; padding-bottom: 2%; } .main-home .meetings-panel .meeting { - background-color: #D3D3D3; - text-align: center; + background-color: lightcoral; + text-align: left; margin-top: 15px; line-height: 2; } @@ -61,7 +61,7 @@ a { .main-home .short-cuts .tile { margin-right: 100%; - background-color: #D3D3D3; + background-color: mistyrose; width: 100px; height: 100px; border-radius: 16px; From 8fb6343b035e2510158be942226913d9cdb33ecb Mon Sep 17 00:00:00 2001 From: mbalsdon Date: Tue, 29 Mar 2022 23:01:57 -0700 Subject: [PATCH 06/12] center and enlargen homepage buttons --- src/components/home/ShortCuts.tsx | 4 ++-- src/style/App.css | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/home/ShortCuts.tsx b/src/components/home/ShortCuts.tsx index 31d530a..fe6ab4e 100644 --- a/src/components/home/ShortCuts.tsx +++ b/src/components/home/ShortCuts.tsx @@ -31,7 +31,7 @@ const ShortCuts: React.FC = ({ users }: Props) => { - + Schedule Meeting @@ -45,7 +45,7 @@ const ShortCuts: React.FC = ({ users }: Props) => { onClose={handleClose} users={users} /> - + Call Group diff --git a/src/style/App.css b/src/style/App.css index 1dd5f3d..79d04c1 100644 --- a/src/style/App.css +++ b/src/style/App.css @@ -54,23 +54,24 @@ a { .main-home .short-cuts .mylabel { display: inline-block; - margin: 0; - width: 100px; + margin-left: 25%; + width: 125px; text-align: center; } .main-home .short-cuts .tile { - margin-right: 100%; + margin-left: 25%; + margin-right: 50%; background-color: mistyrose; - width: 100px; - height: 100px; + width: 125px; + height: 125px; border-radius: 16px; } .main-home .short-cuts .tile .icon { color: black; - width: 70%; - height: 70%; + width: 80%; + height: 80%; } .login .grid-container { From 603452b046007e9cdc6a0ca64658bff39c1e9e43 Mon Sep 17 00:00:00 2001 From: CodeServer Date: Wed, 30 Mar 2022 07:12:27 +0100 Subject: [PATCH 07/12] removed unused mockdata --- src/components/home/CallFavouritesDialog.tsx | 19 +++++-------- src/components/home/Home.tsx | 15 +++++----- src/components/home/ShortCuts.tsx | 19 ++++--------- src/style/App.css | 29 ++++++++++---------- src/style/App.css.map | 2 +- src/style/modules/_mainHome.sass | 29 ++++++++++---------- 6 files changed, 50 insertions(+), 63 deletions(-) diff --git a/src/components/home/CallFavouritesDialog.tsx b/src/components/home/CallFavouritesDialog.tsx index 58d12c1..6156f70 100644 --- a/src/components/home/CallFavouritesDialog.tsx +++ b/src/components/home/CallFavouritesDialog.tsx @@ -15,25 +15,16 @@ import { useAppSelector } from "../../redux/hooks"; import { selectFavorites } from "../../redux/slices/favoritesSlice"; import { selectTeam, selectUsers } from "../../redux/slices/usersSlice"; import GroupSelect from "../sidebar/GroupSelect"; -import { SidebarUserObj } from "./Home"; interface Props { open: boolean; - selectedValue: SidebarUserObj; - onClose: (value: SidebarUserObj) => void; - users: SidebarUserObj[]; + handleClose: () => void; } const CallFavouritesDialog: React.FC = ({ open, - selectedValue, - onClose, - users, + handleClose, }: Props) => { - const handleClose = () => { - onClose(selectedValue); - }; - console.log(users); const [group, setGroup] = useState("Favorites"); const [inputText, setInputText] = useState(""); @@ -60,6 +51,10 @@ const CallFavouritesDialog: React.FC = ({ selectUsers(state, groupMembersUuids) ); + const handleCall = () => { + handleClose(); + }; + return ( Select who to call: @@ -107,7 +102,7 @@ const CallFavouritesDialog: React.FC = ({ - Call Group diff --git a/src/style/App.css b/src/style/App.css index 24fdd0e..79d04c1 100644 --- a/src/style/App.css +++ b/src/style/App.css @@ -11,13 +11,13 @@ a { } .main-home .meetings-panel { - margin: auto; margin-top: 15vh; + padding-bottom: 10vh; border-style: solid; - border-color: #D3D3D3; + border-color: mistyrose; border-width: 2px; border-radius: 40px; - width: 65%; + width: 85%; height: 65vh; overflow: hidden; } @@ -28,14 +28,14 @@ a { .main-home .meetings-panel .panel-label { text-align: center; - background-color: grey; + background-color: #AF000D; padding-top: 2%; padding-bottom: 2%; } .main-home .meetings-panel .meeting { - background-color: #D3D3D3; - text-align: center; + background-color: lightcoral; + text-align: left; margin-top: 15px; line-height: 2; } @@ -54,23 +54,24 @@ a { .main-home .short-cuts .mylabel { display: inline-block; - margin: 0; - width: 100px; + margin-left: 25%; + width: 125px; text-align: center; } .main-home .short-cuts .tile { - margin-right: 100%; - background-color: #D3D3D3; - width: 100px; - height: 100px; + margin-left: 25%; + margin-right: 50%; + background-color: mistyrose; + width: 125px; + height: 125px; border-radius: 16px; } .main-home .short-cuts .tile .icon { color: black; - width: 70%; - height: 70%; + width: 80%; + height: 80%; } .login .grid-container { diff --git a/src/style/App.css.map b/src/style/App.css.map index e1734c0..8a09258 100644 --- a/src/style/App.css.map +++ b/src/style/App.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AG8CA,AAAA,WAAW,CAAC;EACR,KAAK,EAAE,IAAI;CAAG;;AAElB,AAAA,CAAC,CAAC;EACE,eAAe,EAAE,IAAI;CAAG;;AKlD5B,AAAA,UAAU,CAAC;EAGP,SAAS,EAAE,cAAc;CAsDO;;AAzDpC,AAII,UAJM,CAIN,eAAe,CAAC;EACZ,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,IAAI;EAChB,YAAY,EAAE,KAAK;EACnB,YAAY,EPRS,OAAO;EOS5B,YAAY,EAAE,GAAG;EACjB,aAAa,EAAE,IAAI;EACnB,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,IAAI;EACZ,QAAQ,EAAE,MAAM;CAuBW;;AApCnC,AAcQ,UAdE,CAIN,eAAe,CAUX,IAAI,CAAC;EACD,KAAK,EAAE,IAAI;CAAG;;AAf1B,AAgBQ,UAhBE,CAIN,eAAe,CAYX,YAAY,CAAC;EACT,UAAU,EAAE,MAAM;EAClB,gBAAgB,EAAE,IAAI;EACtB,WAAW,EAAE,EAAE;EACf,cAAc,EAAE,EAAE;CAAG;;AApBjC,AA8BQ,UA9BE,CAIN,eAAe,CA0BX,QAAQ,CAAC;EACL,gBAAgB,EP/BC,OAAO;EOgCxB,UAAU,EAAE,MAAM;EAClB,UAAU,EAAE,IAAI;EAChB,WAAW,EAAE,CAAC;CAAG;;AAlC7B,AAmCQ,UAnCE,CAIN,eAAe,CA+BX,YAAY,CAAC;EACT,aAAa,EAAE,GAAG;CAAG;;AApCjC,AAsCQ,UAtCE,CAqCN,WAAW,CACP,M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,WAAW,EAAE,IAAI;CAAG;;AArBhC,AAsBQ,MAtBF,CACF,eAAe,CAqBX,UAAU,CAAC;EACP,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;CAEQ;;AA1BhC,AAyBY,MAzBN,CACF,eAAe,CAqBX,UAAU,CAGN,CAAC,CAAC;EACE,KAAK,EAAE,IAAI;CAAG", "sources": [ "App.sass", "_variables.sass", diff --git a/src/style/modules/_mainHome.sass b/src/style/modules/_mainHome.sass index c66df63..6841f07 100644 --- a/src/style/modules/_mainHome.sass +++ b/src/style/modules/_mainHome.sass @@ -3,20 +3,20 @@ // width: 100% !important max-width: 85% !important .meetings-panel - margin: auto margin-top: 15vh + padding-bottom: 10vh border-style: solid - border-color: $main-home-background-color + border-color: mistyrose border-width: 2px border-radius: 40px - width: 65% + width: 85% height: 65vh overflow: hidden .row width: 100% .panel-label text-align: center - background-color: grey + background-color: #AF000D padding-top: 2% padding-bottom: 2% // .current-time @@ -29,8 +29,8 @@ // background-color: grey // padding-bottom: 1% .meeting - background-color: $main-home-background-color - text-align: center + background-color: lightcoral + text-align: left margin-top: 15px line-height: 2 .lastMeeting @@ -43,16 +43,17 @@ margin-top: 5vh .mylabel display: inline-block - margin: 0 - width: 100px + margin-left: 25% + width: 125px text-align: center .tile - margin-right: 100% - background-color: $main-home-background-color - width: 100px - height: 100px + margin-left: 25% + margin-right: 50% + background-color: mistyrose + width: 125px + height: 125px border-radius: 16px .icon color: black - width: 70% - height: 70% \ No newline at end of file + width: 80% + height: 80% \ No newline at end of file From 9a2da4b441ab94cd15a0ca7d88efa5c83ffe68d1 Mon Sep 17 00:00:00 2001 From: mbalsdon Date: Wed, 30 Mar 2022 00:03:51 -0700 Subject: [PATCH 08/12] change contactspage styling --- .../contacts/contacts-components/Body.tsx | 2 +- .../body-components/LowerBody.tsx | 8 +++++--- .../body-components/UpperBody.tsx | 15 ++++++++------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/contacts/contacts-components/Body.tsx b/src/components/contacts/contacts-components/Body.tsx index b477500..2706ab5 100644 --- a/src/components/contacts/contacts-components/Body.tsx +++ b/src/components/contacts/contacts-components/Body.tsx @@ -16,7 +16,7 @@ const Body: React.FC = (props) => { flexDirection: "column", width: "100%", height: "100%", - mt: 2, + mt: 5, }} > diff --git a/src/components/contacts/contacts-components/body-components/LowerBody.tsx b/src/components/contacts/contacts-components/body-components/LowerBody.tsx index f7645b2..5225536 100644 --- a/src/components/contacts/contacts-components/body-components/LowerBody.tsx +++ b/src/components/contacts/contacts-components/body-components/LowerBody.tsx @@ -24,14 +24,17 @@ const LowerBody: React.FC = (props) => { flexDirection: "column", border: 1, borderRadius: 2, + borderColor: "#af000d", + backgroundColor: "#af000d", width: "70%", height: "60%", alignSelf: "center", }} > - + Upcoming meetings + {/* */} {meetings.map((meeting, i) => ( = (props) => { justifyContent: "space-between", height: "50px", px: "10px", - borderTop: 1, - borderBottom: i === meetings.length - 1 ? 1 : 0, + backgroundColor: i % 2 ? "mistyrose" : "white", }} key={i} > diff --git a/src/components/contacts/contacts-components/body-components/UpperBody.tsx b/src/components/contacts/contacts-components/body-components/UpperBody.tsx index 10b4560..b62526e 100644 --- a/src/components/contacts/contacts-components/body-components/UpperBody.tsx +++ b/src/components/contacts/contacts-components/body-components/UpperBody.tsx @@ -45,6 +45,7 @@ const UpperBody: React.FC = (props) => { flexDirection: "column", border: 1, borderRadius: 2, + borderColor: "#af000d", width: "70%", alignSelf: "center", mb: 2, @@ -59,7 +60,7 @@ const UpperBody: React.FC = (props) => { mx: 4, }} > - {props.contactInfo.name} + {props.contactInfo.name} {!favoritesUuids.includes(props.contactInfo.uuid) ? ( ) : ( - - {getUpcomingMeetingTime(meeting)} - - - ))} - + + + {getUpcomingMeetingTime(meeting)} + + + ))} + + )} ); }; diff --git a/src/components/contacts/contacts-components/body-components/UpperBody.tsx b/src/components/contacts/contacts-components/body-components/UpperBody.tsx index 10b4560..1da27f8 100644 --- a/src/components/contacts/contacts-components/body-components/UpperBody.tsx +++ b/src/components/contacts/contacts-components/body-components/UpperBody.tsx @@ -1,8 +1,6 @@ import { Box, Button, IconButton, Typography } from "@mui/material"; import React from "react"; import PhoneIcon from "@mui/icons-material/Phone"; -import VideocamIcon from "@mui/icons-material/Videocam"; -import GroupsIcon from "@mui/icons-material/Groups"; import AddIcon from "@mui/icons-material/Add"; import UserLite from "../../../../api-bodies/UserLite"; import UserStatus from "../../../../api-bodies/UserStatus"; @@ -18,26 +16,50 @@ import { } from "../../../../redux/slices/favoritesSlice"; import RemoveIcon from "@mui/icons-material/Remove"; import { MeetingStatus } from "../../../../utils"; -import { selectMe } from "../../../../redux/slices/usersSlice"; +import { selectManager, selectMe } from "../../../../redux/slices/usersSlice"; +import axios from "../../../../api/axios"; +import NewMeeting from "../../../../api-bodies/NewMeeting"; interface Props { contactInfo: UserLite; } -const UpperBody: React.FC = (props) => { +const UpperBody: React.FC = ({ contactInfo }) => { const dispatch = useAppDispatch(); const userStatus: UserStatus = useAppSelector((state) => - selectUserStatus(state, props.contactInfo.uuid) + selectUserStatus(state, contactInfo.uuid) ); const me = useAppSelector(selectMe); const favoritesUuids = useAppSelector(selectFavorites); const detailedMeeting = useAppSelector((state) => - selectMeeting(state, userStatus.meetingId) + selectMeeting(state, userStatus.inMeeting ? userStatus.meetingId : null) ); + const managerId = useAppSelector(selectManager); const meetingStatus: MeetingStatus = - userStatus && userStatus.inMeeting - ? MeetingStatus.IN_MEETING - : MeetingStatus.NOT_IN_MEETING; + managerId === contactInfo.uuid + ? MeetingStatus.NOT_AVAILABLE + : userStatus && userStatus.inMeeting + ? MeetingStatus.IN_MEETING + : MeetingStatus.NOT_IN_MEETING; + + const startCall = async () => { + const newMeeting: NewMeeting = { + startTime: "2022-03-30T23:40:00Z", + duration: 30, + topic: `Meeting with ${contactInfo.name}`, + registrantIds: [contactInfo.uuid], + }; + try { + const response = await axios.post( + `/users/${me}/meetings`, + JSON.stringify(newMeeting) + ); + window.open(response.data.joinUrl, "_blank")?.focus(); + } catch (e) { + console.log(e); + } + }; + return ( = (props) => { mx: 4, }} > - {props.contactInfo.name} - {!favoritesUuids.includes(props.contactInfo.uuid) ? ( + {contactInfo.name} + {!favoritesUuids.includes(contactInfo.uuid) ? (
- + {meetings.map((meeting) => { const meetingMembers: UserLite[] = []; participants.forEach((userLite) => { - if (userLite != undefined && meeting.liveParticipantIds.includes(userLite.uuid)) { + if ( + userLite != undefined && + meeting.liveParticipantIds.includes(userLite.uuid) + ) { meetingMembers.push(userLite); } }); - const startDate = new Date(meeting.start); + const startDate = new Date(meeting.startTime); const startDatemil = startDate.getTime(); - const endDatemil = startDatemil + meeting.duration*60000; + const endDatemil = startDatemil + meeting.duration * 60000; const endDate = new Date(endDatemil); const currentDatemil = currentDate.getTime(); if (currentDatemil >= startDatemil && currentDatemil <= endDatemil) { - let lastMeetingClass = meetings.length == i ? " lastMeeting" : ""; + const lastMeetingClass = meetings.length == i ? " lastMeeting" : ""; i += 1; return ( - (" " + userLite.name + " ")).toString()} + meetingName={meeting.topic} + meetingTime={ + formatTimeFromDate(startDate) + + " - " + + formatTimeFromDate(endDate) + } + meetingMembers={meetingMembers + .map((userLite) => " " + userLite.name + " ") + .toString()} /> ); } diff --git a/src/components/home/ShortCuts.tsx b/src/components/home/ShortCuts.tsx index 8979005..31d530a 100644 --- a/src/components/home/ShortCuts.tsx +++ b/src/components/home/ShortCuts.tsx @@ -1,7 +1,5 @@ import PeopleIcon from "@mui/icons-material/People"; -import AddIcon from "@mui/icons-material/Add"; import PhoneEnabledIcon from "@mui/icons-material/PhoneEnabled"; -import CircleIcon from "@mui/icons-material/Circle"; import Button from "@mui/material/Button"; import Grid from "@mui/material/Grid"; import Typography from "@mui/material/Typography"; diff --git a/src/components/login/Login.tsx b/src/components/login/Login.tsx index 36bfd79..177b7de 100644 --- a/src/components/login/Login.tsx +++ b/src/components/login/Login.tsx @@ -9,6 +9,13 @@ import zoomLogo from "../../assets/zoom.png"; import LoginIcon from "@mui/icons-material/Login"; import useAuth from "../../hooks/useAuth"; import axios from "../../api/axios"; +import { store } from "../../redux/store"; +import { fetchFavorites } from "../../redux/slices/favoritesSlice"; +import { + fetchMeetings, + socketActions, +} from "../../redux/slices/meetingsAndUserStatusSlice"; +import { fetchUsers } from "../../redux/slices/usersSlice"; interface LocationState { from: { pathname: string }; @@ -36,13 +43,17 @@ const Login: React.FC = () => { // setErrMsg(''); // }, [user, pwd]) - const handleLogin = async(e: React.SyntheticEvent) => { + const handleLogin = async (e: React.SyntheticEvent) => { e.preventDefault(); try { if (email === "" && password === "") { setAuth["uuid"] = ""; setAuth["isLoggedIn"] = true; + store.dispatch(fetchMeetings("")); + store.dispatch(fetchUsers("")); + store.dispatch(fetchFavorites("")); + store.dispatch(socketActions.startConnecting()); navigate(from, { replace: true }); } @@ -62,6 +73,10 @@ const Login: React.FC = () => { if (logedInUserId != undefined) { setAuth["uuid"] = logedInUserId; setAuth["isLoggedIn"] = true; + store.dispatch(fetchMeetings(logedInUserId)); + store.dispatch(fetchUsers(logedInUserId)); + store.dispatch(fetchFavorites(logedInUserId)); + store.dispatch(socketActions.startConnecting()); navigate(from, { replace: true }); } } catch (error) { diff --git a/src/components/meeting-details/Utils.tsx b/src/components/meeting-details/Utils.tsx index 4af92a2..4fac17e 100644 --- a/src/components/meeting-details/Utils.tsx +++ b/src/components/meeting-details/Utils.tsx @@ -1,16 +1,7 @@ import DetailedMeeting from "../../api-bodies/DetailedMeeting"; -const getMeetingStatus = (meeting: DetailedMeeting) => { - const startDate = new Date(meeting.start); - const endDate = new Date(startDate.getTime() + meeting.duration * 60000); - const currentDate = new Date(); - if (currentDate > startDate && currentDate < endDate) return "Live"; - else if (currentDate < startDate) return "Scheduled"; - else return "Finished"; -}; - const getUpcomingMeetingTime = (meeting: DetailedMeeting) => { - const startDate = new Date(meeting.start); + const startDate = new Date(meeting.startTime); const endDate = new Date(startDate.getTime() + meeting.duration * 60000); const startTime = startDate .toTimeString() @@ -27,4 +18,22 @@ const getUpcomingMeetingTime = (meeting: DetailedMeeting) => { return `${startTime} - ${endTime}`; }; -export { getMeetingStatus, getUpcomingMeetingTime }; +const getMeetingDuration = (meeting: DetailedMeeting) => { + const startDate = new Date(meeting.startTime); + const endDate = new Date(startDate.getTime() + meeting.duration * 60000); + const startDateString = startDate.toDateString(); + const startTimeString = startDate + .toTimeString() + .split(" ")[0] + .split(":") + .splice(0, 2) + .join(":"); + const endTimeString = endDate + .toTimeString() + .split(" ")[0] + .split(":") + .slice(0, 2) + .join(":"); + return `${startDateString} ${startTimeString} - ${endTimeString}`; +}; +export { getUpcomingMeetingTime, getMeetingDuration }; diff --git a/src/components/meeting-details/meeting-details-components/Body.tsx b/src/components/meeting-details/meeting-details-components/Body.tsx index 3eb9062..046525f 100644 --- a/src/components/meeting-details/meeting-details-components/Body.tsx +++ b/src/components/meeting-details/meeting-details-components/Body.tsx @@ -11,18 +11,40 @@ 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"; +import { getMeetingDuration } from "../Utils"; + +enum MeetingStatus { + Live = "Live", + Scheduled = "Scheduled", + Finished = "Finished", +} interface Props { meeting: DetailedMeeting; } -const Body: React.FC = (props) => { +const getMeetingStatus = (meeting: DetailedMeeting) => { + const startDate = new Date(meeting.startTime); + const endDate = new Date(startDate.getTime() + meeting.duration * 60000); + const currentDate = new Date(); + if (meeting.liveParticipantIds.length === 0) { + if (startDate.getTime() - currentDate.getTime() > 0) + return MeetingStatus.Scheduled; + else if (endDate.getTime() - currentDate.getTime() > 0) + return MeetingStatus.Live; + else return MeetingStatus.Finished; + } else { + return MeetingStatus.Live; + } +}; + +const Body: React.FC = ({ meeting }) => { const registrants: UserLite[] = useAppSelector((state) => - selectUsers(state, props.meeting.registrantIds) + selectUsers(state, meeting.registrantIds) ); + const meetingStatus = getMeetingStatus(meeting); return ( = (props) => { height: "100%", }} > - Feb 10, 2022 10:45 am - 11:00 am - Status: {getMeetingStatus(props.meeting)} + {getMeetingDuration(meeting)} + Status: {meetingStatus} Topic: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard diff --git a/src/components/meeting-details/meeting-details-components/Header.tsx b/src/components/meeting-details/meeting-details-components/Header.tsx index aaa76cc..0299555 100644 --- a/src/components/meeting-details/meeting-details-components/Header.tsx +++ b/src/components/meeting-details/meeting-details-components/Header.tsx @@ -6,24 +6,27 @@ import { close } from "../../../redux/slices/meetingDetailsOpenSlice"; import DetailedMeeting from "../../../api-bodies/DetailedMeeting"; interface Props { - meeting: DetailedMeeting | null; + meeting: DetailedMeeting; } -const Header: React.FC = (props) => { +const Header: React.FC = ({ meeting }) => { const dispatch = useAppDispatch(); return ( - {props.meeting !== null ? props.meeting.topic : null} + {meeting !== null ? meeting.topic : null} - - = ({ user, status }: Props) => { setAnchorEl(null); }; + const startCall = async () => { + const newMeeting: NewMeeting = { + startTime: "2022-03-30T23:40:00Z", + duration: 30, + topic: `Meeting with ${user.name}`, + registrantIds: [user.uuid], + }; + try { + const response = await axios.post( + `/users/${me}/meetings`, + JSON.stringify(newMeeting) + ); + window.open(response.data.joinUrl, "_blank")?.focus(); + } catch (e) { + console.log(e); + } + }; + return (
= ({ user, status }: Props) => { > View upcoming meetings - Create meeting + { + handleClose(); + startCall(); + }} + > + Create meeting +
); diff --git a/src/redux/middleware/socketMiddleware.tsx b/src/redux/middleware/socketMiddleware.tsx index 4f47d2f..c843f0f 100644 --- a/src/redux/middleware/socketMiddleware.tsx +++ b/src/redux/middleware/socketMiddleware.tsx @@ -1,10 +1,8 @@ import { Middleware } from "redux"; -import { io, Socket } from "socket.io-client"; -import DetailedMeeting from "../../api-bodies/DetailedMeeting"; import { socketActions } from "../slices/meetingsAndUserStatusSlice"; const socketMiddleware: Middleware = (store) => { - let socket: Socket; + let socket: WebSocket; return (next) => (action) => { const isConnectionEstablished = @@ -14,28 +12,23 @@ const socketMiddleware: Middleware = (store) => { socketActions.startConnecting.match(action) && !isConnectionEstablished ) { - console.log("startConnecting called"); - socket = io("wss://uo5wdcbn6l.execute-api.us-west-2.amazonaws.com/Prod/"); - - socket.on("Connect", () => { - console.log("connected!!!"); - store.dispatch(socketActions.connectionEstablished()); - }); - - socket.on("MeetingCreated", (meeting: DetailedMeeting) => { - store.dispatch(socketActions.meetingCreated(meeting)); - }); - - socket.on( - "UserStatusChange", - (statusChange: { - userId: string; - inMeeting: boolean; - meetingId: string; - }) => { - store.dispatch(socketActions.userStatusChanged(statusChange)); - } + console.log("start connecting"); + socket = new WebSocket( + "wss://uo5wdcbn6l.execute-api.us-west-2.amazonaws.com/Prod/" ); + socket.onopen = () => { + console.log("connected"); + store.dispatch(socketActions.connectionEstablished()); + }; + socket.addEventListener("message", (event: MessageEvent) => { + const json = JSON.parse(event.data); + console.log(json); + if ("inMeeting" in json) { + store.dispatch(socketActions.userStatusChanged(json)); + } else { + store.dispatch(socketActions.meetingCreated(json)); + } + }); } next(action); }; diff --git a/src/redux/slices/meetingsAndUserStatusSlice.tsx b/src/redux/slices/meetingsAndUserStatusSlice.tsx index 1b7a411..6298a9d 100644 --- a/src/redux/slices/meetingsAndUserStatusSlice.tsx +++ b/src/redux/slices/meetingsAndUserStatusSlice.tsx @@ -31,10 +31,10 @@ export const meetingsAndUserStatusSlice = createSlice({ state.isConnected = true; }, meetingCreated: (state, action) => { - state.meetings.push(action.payload.meeting); + state.meetings.push(action.payload); }, userStatusChanged: (state, action) => { - state.userStatuses[action.payload.uuid] = action.payload; + state.userStatuses[action.payload.userId] = action.payload; }, }, extraReducers(builder) { @@ -90,9 +90,25 @@ export const selectMeeting = (state: RootState, meetingID: string | null) => { : null; }; export const selectUserUpcomingMeetings = (state: RootState, uuid: string) => { - return state.meetingsAndUserStatuses.meetings.filter((meeting) => - meeting.registrantIds.includes(uuid) - ); + const isToday = (date: Date) => { + const today = new Date(); + return ( + date.getDate() == today.getDate() && + date.getMonth() == today.getMonth() && + date.getFullYear() == today.getFullYear() + ); + }; + return state.meetingsAndUserStatuses.meetings + .filter( + (meeting) => + meeting.registrantIds.includes(uuid) && + meeting.startTime && + isToday(new Date(meeting.startTime)) + ) + .sort( + (a, b) => + new Date(a.startTime).getTime() - new Date(b.startTime).getTime() + ); }; export const selectUserStatus = ( state: RootState, diff --git a/src/redux/slices/usersSlice.tsx b/src/redux/slices/usersSlice.tsx index 8539c5f..35a0482 100644 --- a/src/redux/slices/usersSlice.tsx +++ b/src/redux/slices/usersSlice.tsx @@ -47,14 +47,14 @@ export const fetchUsers = createAsyncThunk( }; // fetch userfull const userResp = await axios.get(`/users/${uuid}`); - const user: UserFull = userResp.data.user; - + const user: UserFull = userResp.data["user"]; + console.log("1"); users[user.userInfo.uuid] = user.userInfo; - users[user.manager.uuid] = user.manager; + console.log("2"); + if (user.manager) users[user.manager.uuid] = user.manager; team.user = user.userInfo.uuid; - team.manager = user.manager.uuid; - + if (user.manager) team.manager = user.manager.uuid; user.userDirectReports.forEach((userLite) => { users[userLite.uuid] = userLite; team.directReports.push(userLite.uuid); @@ -76,6 +76,7 @@ export const fetchUsers = createAsyncThunk( ); export const selectMe = (state: RootState) => state.users.team.user; +export const selectManager = (state: RootState) => state.users.team.manager; export const selectUser = ( state: RootState, uuid: string | undefined diff --git a/src/utils.tsx b/src/utils.tsx index 3e2ad36..e537354 100644 --- a/src/utils.tsx +++ b/src/utils.tsx @@ -1,6 +1,7 @@ const enum MeetingStatus { NOT_IN_MEETING = "Not in meeting", IN_MEETING = "In meeting", + NOT_AVAILABLE = "Not available", } const getStatusColor = (ms: MeetingStatus): string => { @@ -11,6 +12,9 @@ const getStatusColor = (ms: MeetingStatus): string => { case MeetingStatus.IN_MEETING: { return "#ff7070"; } + case MeetingStatus.NOT_AVAILABLE: { + return "#808080"; + } } }; From 7e9750126972f09706388acc44a1c1dca1429b4b Mon Sep 17 00:00:00 2001 From: Taehee Choi Date: Wed, 30 Mar 2022 04:24:01 -0700 Subject: [PATCH 12/12] minor fixes --- .../body-components/LowerBody.tsx | 7 ++- .../body-components/UpperBody.tsx | 6 +- src/components/home/MeetingsPanel.tsx | 31 +++++++--- .../meeting-details-components/Body.tsx | 62 ++++++++++++++----- 4 files changed, 78 insertions(+), 28 deletions(-) diff --git a/src/components/contacts/contacts-components/body-components/LowerBody.tsx b/src/components/contacts/contacts-components/body-components/LowerBody.tsx index a581061..fa929d4 100644 --- a/src/components/contacts/contacts-components/body-components/LowerBody.tsx +++ b/src/components/contacts/contacts-components/body-components/LowerBody.tsx @@ -25,13 +25,16 @@ const LowerBody: React.FC = (props) => { border: 1, borderRadius: 2, borderColor: "#af000d", - backgroundColor: "#af000d", width: "70%", height: "60%", alignSelf: "center", }} > - + Upcoming meetings {meetings.length === 0 ? ( diff --git a/src/components/contacts/contacts-components/body-components/UpperBody.tsx b/src/components/contacts/contacts-components/body-components/UpperBody.tsx index c3548cf..8f1af91 100644 --- a/src/components/contacts/contacts-components/body-components/UpperBody.tsx +++ b/src/components/contacts/contacts-components/body-components/UpperBody.tsx @@ -96,7 +96,7 @@ const UpperBody: React.FC = ({ contactInfo }) => { ) : (