diff --git a/frontend/src/components/pages/schedule/SchedulePage.tsx b/frontend/src/components/pages/schedule/SchedulePage.tsx index 3e73bc95..add399f1 100644 --- a/frontend/src/components/pages/schedule/SchedulePage.tsx +++ b/frontend/src/components/pages/schedule/SchedulePage.tsx @@ -1,30 +1,173 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import { Flex, + Tabs, + TabList, + Tab, + Heading, + Box, + Button, + IconButton, + Icon, } from "@chakra-ui/react"; -import RoomCard from "../home/HomeRoomCard" -import { residentsMockData } from "../../../mocks/residents"; - -const renderRoomCards = residentsMockData.map(resident => - -) +import { + ArrowBackIosNew, + ArrowForwardIos, + Edit, + FormatListBulleted, + CalendarMonth, +} from "@mui/icons-material"; +import { ScheduleType } from "../../../types/ScheduleTypes"; const SchedulePage = (): React.ReactElement => { + const [rooms, setRooms] = useState([]); + const [scheduleType, setScheduleType] = useState("LIST"); + const [scheduleData, setScheduleData] = useState(""); + const [active, setActive] = useState("List"); + + useEffect(() => { + // TODO: Fetch occupied rooms from API? + setRooms([1, 2, 3, 4, 5, 6]); + }, []); + + useEffect(() => { + if (scheduleType === "LIST") { + setScheduleData("List"); + } else if (scheduleType === "CALENDAR") { + setScheduleData("Calendar"); + } + }, [scheduleType]); + + const selectOption = (e: React.MouseEvent) => { + setActive(e.currentTarget.innerText); + }; + + const formatTabs = (roomNums: number[]) => { + return ( + + + {roomNums.map((room) => ( + + Room {room} + + ))} + + + ); + }; + return ( - -

Schedule Page

- - {renderRoomCards} + + + {formatTabs(rooms)} + + + + + + January 2025 + {/* see announcements page for how to determine what text shows */} + + + + } + /> + + } + /> + + + + + + + + + + + + + + + + + + + + {scheduleType === "CALENDAR" ? ( + TEMP CALENDAR + ) : ( + {scheduleData} + )} + ); }; diff --git a/frontend/src/components/pages/tasks/TasksPage.tsx b/frontend/src/components/pages/tasks/TasksPage.tsx index 6699b269..0c826fcf 100644 --- a/frontend/src/components/pages/tasks/TasksPage.tsx +++ b/frontend/src/components/pages/tasks/TasksPage.tsx @@ -89,39 +89,39 @@ const TasksPage = (): React.ReactElement => { }, [taskType]); return ( - - - - { - setTaskType("REQUIRED"); - }} - > - Required - - { - setTaskType("OPTIONAL"); - }} - > - Optional - - { - setTaskType("CUSTOM"); - }} - > - Custom - - { - setTaskType("CHORE"); - }} - > - Chores - - - + + + + { + setTaskType("REQUIRED"); + }} + > + Required + + { + setTaskType("OPTIONAL"); + }} + > + Optional + + { + setTaskType("CUSTOM"); + }} + > + Custom + + { + setTaskType("CHORE"); + }} + > + Chores + + + diff --git a/frontend/src/theme/buttons.ts b/frontend/src/theme/buttons.ts index 4f267518..c88b4b65 100644 --- a/frontend/src/theme/buttons.ts +++ b/frontend/src/theme/buttons.ts @@ -39,8 +39,28 @@ const del = defineStyle({ border: "2px solid #C5C8D8", }); +const success = defineStyle({ + height: "34px", + borderRadius: "8px", + padding: "4px 16px", + border: "2px solid #0D8312", + bg: "green.100", + color: "green.main", + _hover: { bg: "green.main", color: "green.100" }, +}); + +const error = defineStyle({ + height: "34px", + borderRadius: "8px", + padding: "4px 16px", + border: "2px solid #D34C5C", + bg: "red.100", + color: "red.main", + _hover: { bg: "red.main", color: "red.100" }, +}); + const buttonTheme = defineStyleConfig({ - variants: { primary, secondary, cancel, del }, + variants: { primary, secondary, cancel, del, success, error }, }); export default buttonTheme; diff --git a/frontend/src/theme/colors.ts b/frontend/src/theme/colors.ts index 819c4b12..18066e0e 100644 --- a/frontend/src/theme/colors.ts +++ b/frontend/src/theme/colors.ts @@ -3,6 +3,7 @@ const colors = { white: "#fff", gray: { main: "#808080", + 50: "FBFBFB", 100: "#F5F6F8", 200: "#E3E4EA", 300: "#C5C8D8", @@ -16,8 +17,12 @@ const colors = { }, red: { main: "#D34C5C", - error: "#E30000", + 100: "#FFE6E6", }, + green: { + main: "#0D8312", + 100: "#ECFFED", + } }; export default colors; diff --git a/frontend/src/types/RoomTypes.ts b/frontend/src/types/RoomTypes.ts new file mode 100644 index 00000000..1e1b7710 --- /dev/null +++ b/frontend/src/types/RoomTypes.ts @@ -0,0 +1,5 @@ +export interface Room { + author: string; + message: string; + createdAt: string; + } diff --git a/frontend/src/types/ScheduleTypes.ts b/frontend/src/types/ScheduleTypes.ts new file mode 100644 index 00000000..8ce5b749 --- /dev/null +++ b/frontend/src/types/ScheduleTypes.ts @@ -0,0 +1,15 @@ +export type ScheduleType = "LIST" | "CALENDAR" + +export interface Task { + title: string; + description: string; + creditValue: number; +} + +export interface CustomTask extends Task { + room: number; +} + +export interface ChoreTask extends Task { + location: string; +}