Archived
Merge branch 'main' into home
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
const Calendar: React.FC = () => {
|
||||
return <span>Calendar</span>;
|
||||
};
|
||||
|
||||
export default Calendar;
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Toolbar } from "@mui/material";
|
||||
import UserCalendar from "./UserCalendar";
|
||||
|
||||
const CalendarPage: React.FC = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Toolbar />
|
||||
<UserCalendar />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default CalendarPage;
|
||||
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
Test data from
|
||||
https://github.com/jquense/react-big-calendar/blob/master/examples/events.js
|
||||
*/
|
||||
|
||||
const now = new Date();
|
||||
|
||||
export default [
|
||||
{
|
||||
id: 0,
|
||||
title: "All Day Event very long title",
|
||||
allDay: true,
|
||||
start: new Date(2022, 2, 0),
|
||||
end: new Date(2022, 2, 1),
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: "Long Event",
|
||||
start: new Date(2022, 2, 7),
|
||||
end: new Date(2022, 2, 10),
|
||||
},
|
||||
|
||||
{
|
||||
id: 2,
|
||||
title: "DTS STARTS",
|
||||
start: new Date(2022, 1, 13, 0, 0, 0),
|
||||
end: new Date(2022, 1, 20, 0, 0, 0),
|
||||
},
|
||||
|
||||
{
|
||||
id: 3,
|
||||
title: "DTS ENDS",
|
||||
start: new Date(2022, 9, 6, 0, 0, 0),
|
||||
end: new Date(2022, 9, 13, 0, 0, 0),
|
||||
},
|
||||
|
||||
{
|
||||
id: 4,
|
||||
title: "Some Event",
|
||||
start: new Date(2022, 2, 9, 0, 0, 0),
|
||||
end: new Date(2022, 2, 10, 0, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: "Conference",
|
||||
start: new Date(2022, 2, 11),
|
||||
end: new Date(2022, 2, 13),
|
||||
desc: "Big conference for important people",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
title: "Meeting",
|
||||
start: new Date(2022, 2, 12, 10, 30, 0, 0),
|
||||
end: new Date(2022, 2, 12, 12, 30, 0, 0),
|
||||
desc: "Pre-meeting meeting, to prepare for the meeting",
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
title: "Lunch",
|
||||
start: new Date(2022, 2, 12, 12, 0, 0, 0),
|
||||
end: new Date(2022, 2, 12, 13, 0, 0, 0),
|
||||
desc: "Power lunch",
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
title: "Meeting",
|
||||
start: new Date(2022, 2, 12, 14, 0, 0, 0),
|
||||
end: new Date(2022, 2, 12, 15, 0, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
title: "Happy Hour",
|
||||
start: new Date(2022, 2, 12, 17, 0, 0, 0),
|
||||
end: new Date(2022, 2, 12, 17, 30, 0, 0),
|
||||
desc: "Most important meal of the day",
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
title: "Dinner",
|
||||
start: new Date(2022, 2, 12, 20, 0, 0, 0),
|
||||
end: new Date(2022, 2, 12, 21, 0, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
title: "Planning Meeting with Paige",
|
||||
start: new Date(2022, 2, 13, 8, 0, 0),
|
||||
end: new Date(2022, 2, 13, 10, 30, 0),
|
||||
},
|
||||
{
|
||||
id: 11.1,
|
||||
title: "Inconvenient multi-day Conference Call",
|
||||
start: new Date(2022, 2, 13, 9, 30, 0),
|
||||
end: new Date(2022, 2, 14, 1, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 11.2,
|
||||
title: "Project Kickoff - Lou's Shoes",
|
||||
start: new Date(2022, 2, 13, 11, 30, 0),
|
||||
end: new Date(2022, 2, 13, 14, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 11.3,
|
||||
title: "Quote Follow-up - Tea by Tina",
|
||||
start: new Date(2022, 2, 13, 15, 30, 0),
|
||||
end: new Date(2022, 2, 13, 16, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
title: "Late Night Event",
|
||||
start: new Date(2022, 2, 17, 19, 30, 0),
|
||||
end: new Date(2022, 2, 18, 2, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 12.5,
|
||||
title: "Late Same Night Event",
|
||||
start: new Date(2022, 2, 17, 19, 30, 0),
|
||||
end: new Date(2022, 2, 17, 23, 30, 0),
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
title: "Multi-day Event",
|
||||
start: new Date(2022, 2, 20, 19, 30, 0),
|
||||
end: new Date(2022, 2, 22, 2, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
title: "Today",
|
||||
start: new Date(new Date().setHours(new Date().getHours() - 3)),
|
||||
end: new Date(new Date().setHours(new Date().getHours() + 3)),
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
title: "Point in Time Event",
|
||||
start: now,
|
||||
end: now,
|
||||
},
|
||||
{
|
||||
id: 16,
|
||||
title: "Video Record",
|
||||
start: new Date(2022, 2, 14, 15, 30, 0),
|
||||
end: new Date(2022, 2, 14, 19, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 17,
|
||||
title: "Dutch Song Producing",
|
||||
start: new Date(2022, 2, 14, 16, 30, 0),
|
||||
end: new Date(2022, 2, 14, 20, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 18,
|
||||
title: "Itaewon Halloween Meeting",
|
||||
start: new Date(2022, 2, 14, 16, 30, 0),
|
||||
end: new Date(2022, 2, 14, 17, 30, 0),
|
||||
},
|
||||
{
|
||||
id: 19,
|
||||
title: "Online Coding Test",
|
||||
start: new Date(2022, 2, 14, 17, 30, 0),
|
||||
end: new Date(2022, 2, 14, 20, 30, 0),
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
title: "An overlapped Event",
|
||||
start: new Date(2022, 2, 14, 17, 0, 0),
|
||||
end: new Date(2022, 2, 14, 18, 30, 0),
|
||||
},
|
||||
{
|
||||
id: 21,
|
||||
title: "Phone Interview",
|
||||
start: new Date(2022, 2, 14, 17, 0, 0),
|
||||
end: new Date(2022, 2, 14, 18, 30, 0),
|
||||
},
|
||||
{
|
||||
id: 22,
|
||||
title: "Cooking Class",
|
||||
start: new Date(2022, 2, 14, 17, 30, 0),
|
||||
end: new Date(2022, 2, 14, 19, 0, 0),
|
||||
},
|
||||
{
|
||||
id: 23,
|
||||
title: "Go to the gym",
|
||||
start: new Date(2022, 2, 14, 18, 30, 0),
|
||||
end: new Date(2022, 2, 14, 20, 0, 0),
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Calendar, momentLocalizer } from "react-big-calendar";
|
||||
import moment from "moment";
|
||||
import testEvents from "./Events";
|
||||
|
||||
import "react-big-calendar/lib/css/react-big-calendar.css";
|
||||
|
||||
const localizer = momentLocalizer(moment);
|
||||
|
||||
const UserCalendar: React.FC = () => {
|
||||
|
||||
return (
|
||||
<Calendar
|
||||
events={testEvents}
|
||||
views={["month", "week", "day"]}
|
||||
step={60}
|
||||
showMultiDayTimes
|
||||
localizer={localizer}
|
||||
style={{ height: "80%" }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default UserCalendar;
|
||||
@@ -1,8 +0,0 @@
|
||||
import Status from "./Status";
|
||||
|
||||
interface ContactInfo {
|
||||
name: string;
|
||||
status: Status;
|
||||
}
|
||||
|
||||
export default ContactInfo;
|
||||
@@ -2,25 +2,19 @@ import { Box } from "@mui/material";
|
||||
import React from "react";
|
||||
import Body from "./contacts-components/Body";
|
||||
|
||||
import ContactInfo from "./ContactInfo";
|
||||
import Sidebar from "./contacts-components/Sidebar";
|
||||
import UserLite from "../../api-bodies/UserLite";
|
||||
|
||||
interface Props {
|
||||
setMeetingInfoOpen: (open: boolean) => void;
|
||||
}
|
||||
|
||||
const Contacts: React.FC<Props> = (props) => {
|
||||
const [contactSelected, setContactSelected] =
|
||||
React.useState<ContactInfo | null>(null);
|
||||
const Contacts: React.FC = () => {
|
||||
const [contactSelected, setContactSelected] = React.useState<UserLite | null>(
|
||||
null
|
||||
);
|
||||
|
||||
return (
|
||||
<Box sx={{ display: "flex", height: "100%" }}>
|
||||
<Sidebar setContactSelected={setContactSelected} />
|
||||
{contactSelected !== null ? (
|
||||
<Body
|
||||
contactSelected={contactSelected}
|
||||
setMeetingInfoOpen={props.setMeetingInfoOpen}
|
||||
/>
|
||||
<Body contactSelected={contactSelected} />
|
||||
) : null}
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import DetailedMeeting from "../../api-bodies/DetailedMeeting";
|
||||
import Status from "./Status";
|
||||
|
||||
const returnStatusColor = (
|
||||
@@ -15,4 +16,10 @@ const returnStatusColor = (
|
||||
}
|
||||
};
|
||||
|
||||
export { returnStatusColor };
|
||||
const getMeetingDuration = (meeting: DetailedMeeting) => {
|
||||
const startDate = new Date(meeting.start);
|
||||
const endDate = new Date(startDate.getTime() + meeting.duration * 60000);
|
||||
return `${startDate.toTimeString()} - ${endDate.toTimeString()}`;
|
||||
};
|
||||
|
||||
export { returnStatusColor, getMeetingDuration };
|
||||
|
||||
@@ -2,11 +2,10 @@ import { Box, Toolbar } from "@mui/material";
|
||||
import React from "react";
|
||||
import UpperBody from "./body-components/UpperBody";
|
||||
import LowerBody from "./body-components/LowerBody";
|
||||
import ContactInfo from "../ContactInfo";
|
||||
import UserLite from "../../../api-bodies/UserLite";
|
||||
|
||||
interface Props {
|
||||
contactSelected: ContactInfo;
|
||||
setMeetingInfoOpen: (open: boolean) => void;
|
||||
contactSelected: UserLite;
|
||||
}
|
||||
|
||||
const Body: React.FC<Props> = (props) => {
|
||||
@@ -21,10 +20,7 @@ const Body: React.FC<Props> = (props) => {
|
||||
>
|
||||
<Toolbar />
|
||||
<UpperBody contactInfo={props.contactSelected} />
|
||||
<LowerBody
|
||||
contactInfo={props.contactSelected}
|
||||
setMeetingInfoOpen={props.setMeetingInfoOpen}
|
||||
/>
|
||||
<LowerBody contactInfo={props.contactSelected} />
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -9,19 +9,17 @@ import {
|
||||
} from "@mui/material";
|
||||
import React from "react";
|
||||
import { ExpandLess, ExpandMore } from "@mui/icons-material";
|
||||
import ContactInfo from "../ContactInfo";
|
||||
import Status from "../Status";
|
||||
import ContactItem from "./sidebar-components/ContactItem";
|
||||
|
||||
const contacts: ContactInfo[] = [
|
||||
{ name: "Taehee ...", status: Status.Online },
|
||||
{ name: "Jincheng ...", status: Status.Offline },
|
||||
{ name: "Mathew ...", status: Status.InMeeting },
|
||||
{ name: "Esteban ...", status: Status.Away },
|
||||
];
|
||||
import { useAppSelector } from "../../../redux/hooks";
|
||||
import {
|
||||
selectFavoritesJSON,
|
||||
selectTeamJSON,
|
||||
} from "../../../redux/slices/peopleSlice";
|
||||
import { selectFavorites } from "../../../redux/slices/favoritesSlice";
|
||||
import UserLite from "../../../api-bodies/UserLite";
|
||||
|
||||
interface Props {
|
||||
setContactSelected: (contactInfo: ContactInfo) => void;
|
||||
setContactSelected: (contactInfo: UserLite) => void;
|
||||
}
|
||||
|
||||
const sidebarWidth = 240;
|
||||
@@ -30,6 +28,12 @@ const Sidebar: React.FC<Props> = (props) => {
|
||||
const [favoritesOpen, setFavoritesOpen] = React.useState<boolean>(true);
|
||||
const [teamOpen, setTeamOpen] = React.useState<boolean>(false);
|
||||
|
||||
const favorites = useAppSelector(selectFavorites);
|
||||
const favoritesJSON = useAppSelector((state) =>
|
||||
selectFavoritesJSON(state, favorites)
|
||||
);
|
||||
const teamJSON = useAppSelector(selectTeamJSON);
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
variant="permanent"
|
||||
@@ -49,13 +53,16 @@ const Sidebar: React.FC<Props> = (props) => {
|
||||
<ListItemButton onClick={() => setFavoritesOpen(!favoritesOpen)}>
|
||||
{favoritesOpen ? <ExpandLess /> : <ExpandMore />}
|
||||
<ListItemText primary="Favorites" sx={{ textAlign: "center" }} />
|
||||
<ListItemText primary="10" sx={{ textAlign: "right" }} />
|
||||
<ListItemText
|
||||
primary={favoritesJSON.length}
|
||||
sx={{ textAlign: "right" }}
|
||||
/>
|
||||
</ListItemButton>
|
||||
<Collapse in={favoritesOpen} timeout="auto" unmountOnExit>
|
||||
<List disablePadding>
|
||||
{contacts.map((contact, i) => (
|
||||
{favoritesJSON.map((favorite, i) => (
|
||||
<ContactItem
|
||||
contactInfo={contact}
|
||||
contactInfo={favorite}
|
||||
key={i}
|
||||
setContactSelected={props.setContactSelected}
|
||||
/>
|
||||
@@ -65,13 +72,13 @@ const Sidebar: React.FC<Props> = (props) => {
|
||||
<ListItemButton onClick={() => setTeamOpen(!teamOpen)}>
|
||||
{teamOpen ? <ExpandLess /> : <ExpandMore />}
|
||||
<ListItemText primary="Team" sx={{ textAlign: "center" }} />
|
||||
<ListItemText primary="10" sx={{ textAlign: "right" }} />
|
||||
<ListItemText primary={teamJSON.length} sx={{ textAlign: "right" }} />
|
||||
</ListItemButton>
|
||||
<Collapse in={teamOpen} timeout="auto" unmountOnExit>
|
||||
<List disablePadding>
|
||||
{contacts.map((contact, i) => (
|
||||
{teamJSON.map((member, i) => (
|
||||
<ContactItem
|
||||
contactInfo={contact}
|
||||
contactInfo={member}
|
||||
key={i}
|
||||
setContactSelected={props.setContactSelected}
|
||||
/>
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
import { Box, Button, List, Typography } from "@mui/material";
|
||||
import React from "react";
|
||||
import ContactInfo from "../../ContactInfo";
|
||||
|
||||
const meetings: { name: string; duration: string }[] = [
|
||||
{ name: "Kanban Meeting", duration: "10:45 am - 11:45 am" },
|
||||
{ name: "Design Meeting", duration: "10:45 am - 11:45 am" },
|
||||
{ name: "Customer Meeting", duration: "10:45 am - 11:45 am" },
|
||||
{ name: "Some kind of Meeting", duration: "10:45 am - 11:45 am" },
|
||||
{ name: "Some kind of Meeting", duration: "10:45 am - 11:45 am" },
|
||||
];
|
||||
import UserLite from "../../../../api-bodies/UserLite";
|
||||
import { useAppSelector, useAppDispatch } from "../../../../redux/hooks";
|
||||
import { open } from "../../../../redux/slices/meetingDetailsOpenSlice";
|
||||
import { selectUserUpcomingMeetings } from "../../../../redux/slices/meetingsSlice";
|
||||
import { getMeetingDuration } from "../../Utils";
|
||||
|
||||
interface Props {
|
||||
contactInfo: ContactInfo;
|
||||
setMeetingInfoOpen: (open: boolean) => void;
|
||||
contactInfo: UserLite;
|
||||
}
|
||||
|
||||
const LowerBody: React.FC<Props> = (props) => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const meetings = useAppSelector((state) =>
|
||||
selectUserUpcomingMeetings(state, props.contactInfo.uuid)
|
||||
);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
@@ -47,11 +48,13 @@ const LowerBody: React.FC<Props> = (props) => {
|
||||
<Button
|
||||
variant="text"
|
||||
color="info"
|
||||
onClick={() => props.setMeetingInfoOpen(true)}
|
||||
onClick={() => dispatch(open(meeting))}
|
||||
>
|
||||
{meeting.name}
|
||||
{meeting.topic}
|
||||
</Button>
|
||||
<Typography sx={{ pt: 1.5 }}>{meeting.duration}</Typography>
|
||||
<Typography sx={{ pt: 1.5 }}>
|
||||
{getMeetingDuration(meeting)}
|
||||
</Typography>
|
||||
</Box>
|
||||
))}
|
||||
</List>
|
||||
|
||||
@@ -3,11 +3,12 @@ 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 ContactInfo from "../../ContactInfo";
|
||||
import AddIcon from "@mui/icons-material/Add";
|
||||
import Status from "../../Status";
|
||||
import UserLite from "../../../../api-bodies/UserLite";
|
||||
|
||||
interface Props {
|
||||
contactInfo: ContactInfo;
|
||||
contactInfo: UserLite;
|
||||
}
|
||||
|
||||
const UpperBody: React.FC<Props> = (props) => {
|
||||
@@ -63,9 +64,7 @@ const UpperBody: React.FC<Props> = (props) => {
|
||||
</IconButton>
|
||||
</Box>
|
||||
<Box sx={{ display: "flex", flexDirection: "column" }}>
|
||||
<Typography sx={{ textAlign: "right" }}>
|
||||
{props.contactInfo.status}
|
||||
</Typography>
|
||||
<Typography sx={{ textAlign: "right" }}>{Status.Online}</Typography>
|
||||
<Typography>MeetingName-1372</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -2,12 +2,13 @@ import { ListItemButton, ListItemIcon, ListItemText } from "@mui/material";
|
||||
import React from "react";
|
||||
import PersonOutlineIcon from "@mui/icons-material/PersonOutline";
|
||||
import CircleIcon from "@mui/icons-material/Circle";
|
||||
import ContactInfo from "../../ContactInfo";
|
||||
import { returnStatusColor } from "../../Utils";
|
||||
import UserLite from "../../../../api-bodies/UserLite";
|
||||
import Status from "../../Status";
|
||||
|
||||
interface Props {
|
||||
contactInfo: ContactInfo;
|
||||
setContactSelected: (contactInfo: ContactInfo) => void;
|
||||
contactInfo: UserLite;
|
||||
setContactSelected: (contactInfo: UserLite) => void;
|
||||
}
|
||||
|
||||
const ContactItem: React.FC<Props> = (props) => {
|
||||
@@ -22,10 +23,10 @@ const ContactItem: React.FC<Props> = (props) => {
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary={props.contactInfo.name}
|
||||
secondary={props.contactInfo.status}
|
||||
secondary={Status.Online}
|
||||
sx={{ flexGrow: 1 }}
|
||||
/>
|
||||
<CircleIcon color={returnStatusColor(props.contactInfo.status)} />
|
||||
<CircleIcon color={returnStatusColor(Status.Online)} />
|
||||
</ListItemButton>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Button, Checkbox, Dialog, DialogActions, DialogContent, DialogTitle, FormControlLabel, FormGroup, Typography } from "@mui/material";
|
||||
import { SidebarUserObj } from "../sidebar/SidebarUser";
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
selectedValue: SidebarUserObj;
|
||||
onClose: (value: SidebarUserObj) => void;
|
||||
users: SidebarUserObj[];
|
||||
}
|
||||
|
||||
const CallFavouritesDialog: React.FC<Props> = ({ open, selectedValue, onClose, users }: Props) => {
|
||||
const handleClose = () => {
|
||||
onClose(selectedValue);
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
onClose={handleClose}
|
||||
open={open}
|
||||
fullWidth
|
||||
maxWidth="sm"
|
||||
>
|
||||
<DialogTitle>Select who to call:</DialogTitle>
|
||||
<DialogContent>
|
||||
<FormControlLabel control={<Checkbox color="success" />} label="Select everyone" />
|
||||
</DialogContent>
|
||||
<DialogContent sx={{ height: "40vh" }} dividers>
|
||||
<FormGroup>
|
||||
{users.map((user) => (
|
||||
<FormControlLabel key={user.id} control={<Checkbox color="success" />} label={user.name} />
|
||||
))}
|
||||
</FormGroup>
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<Button color="success" onClick={handleClose}>
|
||||
<Typography variant="button" color="black">Call</Typography>
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
export default CallFavouritesDialog;
|
||||
@@ -2,8 +2,22 @@ import MeetingsPanel from "./MeetingsPanel";
|
||||
import ShortCuts from "./ShortCuts";
|
||||
import Container from "@mui/material/Container";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import { MeetingStatus, SidebarUserObj } from "../sidebar/SidebarUser";
|
||||
import { useState } from "react";
|
||||
|
||||
const Home: React.FC = () => {
|
||||
|
||||
/* Temporary data - this is the same as what's in ProtectedRoute.tsx so it should not
|
||||
be duplicated like this in the future (Route components were being weird when I tried
|
||||
to pass it down from App.tsx) */
|
||||
const [mockUsers] = useState<SidebarUserObj[]>([
|
||||
{ id: 0, name: "Jincheng L.", meetingStatus: MeetingStatus.ONLINE },
|
||||
{ id: 1, name: "Matt B.", meetingStatus: MeetingStatus.IN_MEETING },
|
||||
{ id: 2, name: "Taehee C.", meetingStatus: MeetingStatus.OFFLINE },
|
||||
{ id: 3, name: "Bob A.", meetingStatus: MeetingStatus.AWAY }
|
||||
]);
|
||||
|
||||
|
||||
return (
|
||||
<Container className="main-home">
|
||||
<Grid container>
|
||||
@@ -11,7 +25,7 @@ const Home: React.FC = () => {
|
||||
<MeetingsPanel />
|
||||
</Grid>
|
||||
<Grid item sm={4}>
|
||||
<ShortCuts />
|
||||
<ShortCuts users={mockUsers}/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -5,8 +5,27 @@ 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";
|
||||
import { SidebarUserObj } from "../sidebar/SidebarUser";
|
||||
import CallFavouritesDialog from "./CallFavouritesDialog";
|
||||
import { useState } from "react";
|
||||
|
||||
interface Props {
|
||||
users: SidebarUserObj[];
|
||||
}
|
||||
|
||||
const ShortCuts: React.FC<Props> = ({ users }: Props) => {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [selectedValue, setSelectedValue] = useState(users[0]);
|
||||
|
||||
const handleClickOpen = () => {
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
const handleClose = (value: SidebarUserObj) => {
|
||||
setOpen(false);
|
||||
setSelectedValue(value);
|
||||
};
|
||||
|
||||
const ShortCuts: React.FC = () => {
|
||||
return (
|
||||
<div className="short-cuts" >
|
||||
<Grid className="row-1" container spacing={1}>
|
||||
@@ -25,9 +44,14 @@ const ShortCuts: React.FC = () => {
|
||||
</Grid>
|
||||
<Grid className="row-2" container spacing={1}>
|
||||
<Grid item sm={6}>
|
||||
<Button className="tile">
|
||||
<Button className="tile" onClick={handleClickOpen}>
|
||||
<PhoneEnabledIcon className="icon" />
|
||||
</Button>
|
||||
<CallFavouritesDialog
|
||||
selectedValue={selectedValue}
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
users={users}/>
|
||||
<Typography className="mylabel" sx={{ ml: 1 }}>Call Favourites</Typography>
|
||||
</Grid>
|
||||
<Grid item sm={6}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useContext } from "react";
|
||||
import { useLocation, Link, useNavigate } from "react-router-dom";
|
||||
import { Stack } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
import Container from "@mui/material/Container";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Button from "@mui/material/Button";
|
||||
@@ -9,13 +9,16 @@ import zoomLogo from "../../assets/zoom.png";
|
||||
import LoginIcon from "@mui/icons-material/Login";
|
||||
import useAuth from "../../hooks/useAuth";
|
||||
|
||||
interface LocationState {
|
||||
from: { pathname: string };
|
||||
}
|
||||
const Login: React.FC = () => {
|
||||
|
||||
const { setAuth }: any = useAuth();
|
||||
const setAuth = useAuth();
|
||||
|
||||
const navigate = useNavigate();
|
||||
const location: any = useLocation();
|
||||
const from = location.state?.from?.pathname || "/";
|
||||
const location = useLocation();
|
||||
const state = location.state as LocationState;
|
||||
const from = state?.from?.pathname || "/";
|
||||
|
||||
const [username, setUsername] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
@@ -34,8 +37,10 @@ const Login: React.FC = () => {
|
||||
|
||||
const handleLogin = () => {
|
||||
if (username === "" && password === "") {
|
||||
setAuth({username: username, isLoggedIn: true});
|
||||
navigate(from, {replace: true});
|
||||
// setAuth({username: username, isLoggedIn: true});
|
||||
setAuth["username"] = username;
|
||||
setAuth["isLoggedIn"] = true;
|
||||
navigate(from, { replace: true });
|
||||
}
|
||||
setUsername("");
|
||||
setPassword("");
|
||||
@@ -44,23 +49,52 @@ const Login: React.FC = () => {
|
||||
return (
|
||||
<Container className="login">
|
||||
<Stack className="grid-container" spacing={2}>
|
||||
<img className="login-logo" src={hsbcLogo} alt="HSBC Logo"/>
|
||||
<img className="login-logo" src={hsbcLogo} alt="HSBC Logo" />
|
||||
{/* <p ref={errRef} className={errMsg ? "errmsg" : "offscreen"} aria-live="assertive">{errMsg}</p> */}
|
||||
<TextField className="username-input" id="outlined-basic" label="Username" variant="outlined" placeholder="Username" onChange={(event) => {setUsername(event.target.value)}}/>
|
||||
<TextField className="password-input" id="outlined-basic" label="Password" variant="outlined" placeholder="Password" type="password" onChange={(event) => {setPassword(event.target.value)}}/>
|
||||
<TextField
|
||||
className="username-input"
|
||||
id="outlined-basic"
|
||||
label="Username"
|
||||
variant="outlined"
|
||||
placeholder="Username"
|
||||
onChange={(event) => {
|
||||
setUsername(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
className="password-input"
|
||||
id="outlined-basic"
|
||||
label="Password"
|
||||
variant="outlined"
|
||||
placeholder="Password"
|
||||
type="password"
|
||||
onChange={(event) => {
|
||||
setPassword(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<Stack direction="row" justifyContent="space-between" spacing={2}>
|
||||
<a className="register-btn" href="#">Forgotten Your Password?</a>
|
||||
<Button endIcon={<LoginIcon />} className="login-btn" variant="contained" type="submit" onClick={handleLogin}>Login</Button>
|
||||
<a className="register-btn" href="#">
|
||||
<Typography sx={{ ml: 1, mb: 1 }}>Forgot your password?</Typography>
|
||||
</a>
|
||||
<Button
|
||||
endIcon={<LoginIcon />}
|
||||
className="login-btn"
|
||||
variant="contained"
|
||||
type="submit"
|
||||
onClick={handleLogin}
|
||||
>
|
||||
Login
|
||||
</Button>
|
||||
</Stack>
|
||||
<Stack direction="row" justifyContent="space-between" spacing={2}>
|
||||
<label>Login with</label>
|
||||
<Typography sx={{ ml: 1 }}>Login with</Typography>
|
||||
<a className="zoom-logo" href="#">
|
||||
<img src={zoomLogo} alt="Zoom Logo"/>
|
||||
<img src={zoomLogo} alt="Zoom Logo" />
|
||||
</a>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
export default Login;
|
||||
|
||||
export default Login;
|
||||
|
||||
@@ -2,17 +2,24 @@ import { Dialog } from "@mui/material";
|
||||
import React from "react";
|
||||
import Body from "./meeting-details-components/Body";
|
||||
import Header from "./meeting-details-components/Header";
|
||||
import { useAppSelector, useAppDispatch } from "../../redux/hooks";
|
||||
import {
|
||||
close,
|
||||
selectMeetingDetailsOpen,
|
||||
} from "../../redux/slices/meetingDetailsOpenSlice";
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
setOpen: (open: boolean) => void;
|
||||
}
|
||||
const MeetingDetails: React.FC = () => {
|
||||
const meetingDetailsOpen = useAppSelector(selectMeetingDetailsOpen);
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const MeetingDetails: React.FC<Props> = (props) => {
|
||||
return (
|
||||
<Dialog fullScreen open={props.open} onClose={() => props.setOpen(false)}>
|
||||
<Header setOpen={props.setOpen} />
|
||||
<Body />
|
||||
<Dialog
|
||||
fullScreen
|
||||
open={meetingDetailsOpen.open}
|
||||
onClose={() => dispatch(close())}
|
||||
>
|
||||
<Header meeting={meetingDetailsOpen.meeting} />
|
||||
<Body meeting={meetingDetailsOpen.meeting} />
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,8 +8,13 @@ import {
|
||||
} from "@mui/material";
|
||||
import React from "react";
|
||||
import PersonOutlineIcon from "@mui/icons-material/PersonOutline";
|
||||
import DetailedMeeting from "../../../api-bodies/DetailedMeeting";
|
||||
|
||||
const Body: React.FC = () => {
|
||||
interface Props {
|
||||
meeting: DetailedMeeting | null;
|
||||
}
|
||||
|
||||
const Body: React.FC<Props> = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
import { AppBar, Button, IconButton, Toolbar, Typography } from "@mui/material";
|
||||
import React from "react";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import { useAppDispatch } from "../../../redux/hooks";
|
||||
import { close } from "../../../redux/slices/meetingDetailsOpenSlice";
|
||||
import DetailedMeeting from "../../../api-bodies/DetailedMeeting";
|
||||
|
||||
interface Props {
|
||||
setOpen: (open: boolean) => void;
|
||||
meeting: DetailedMeeting | null;
|
||||
}
|
||||
|
||||
const Header: React.FC<Props> = (props) => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
return (
|
||||
<AppBar sx={{ position: "relative" }}>
|
||||
<Toolbar>
|
||||
<Typography variant="h6" sx={{ flexGrow: 1 }}>
|
||||
Kanban Meeting
|
||||
{props.meeting !== null ? props.meeting.topic : null}
|
||||
</Typography>
|
||||
<Button variant="contained" color="secondary">
|
||||
Join
|
||||
@@ -23,7 +28,7 @@ const Header: React.FC<Props> = (props) => {
|
||||
edge="start"
|
||||
color="inherit"
|
||||
aria-label="close"
|
||||
onClick={() => props.setOpen(false)}
|
||||
onClick={() => dispatch(close())}
|
||||
sx={{ ml: 1 }}
|
||||
>
|
||||
<CloseIcon />
|
||||
|
||||
Reference in New Issue
Block a user