diff --git a/src/components/Dropdowns/ClassDropdown.tsx b/src/components/Dropdowns/ClassDropdown.tsx index cbde925..0373ff4 100644 --- a/src/components/Dropdowns/ClassDropdown.tsx +++ b/src/components/Dropdowns/ClassDropdown.tsx @@ -4,7 +4,7 @@ import { useRouter } from "next/router"; import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; import { handleSelect } from "./functions"; -function DropdownClass({ classes }) { +function DropdownClass({ classes }: { classes: nameValueType[] }) { const [searchClass, setSearchClass] = useState(""); const [lastSelect, setLastSelect] = useState(""); const router = useRouter(); diff --git a/src/components/Dropdowns/RoomDropdown.tsx b/src/components/Dropdowns/RoomDropdown.tsx index 9d6b014..a86c8eb 100644 --- a/src/components/Dropdowns/RoomDropdown.tsx +++ b/src/components/Dropdowns/RoomDropdown.tsx @@ -4,7 +4,7 @@ import { useRouter } from "next/router"; import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; import { handleSelect } from "./functions"; -function DropdownRoom({ rooms }) { +function DropdownRoom({ rooms }: { rooms: nameValueType[] }) { const [searchRoom, setSearchRoom] = useState(""); const [lastSelect, setLastSelect] = useState(""); const router = useRouter(); diff --git a/src/components/Dropdowns/TeacherDropdown.tsx b/src/components/Dropdowns/TeacherDropdown.tsx index 762b5c8..c779dab 100644 --- a/src/components/Dropdowns/TeacherDropdown.tsx +++ b/src/components/Dropdowns/TeacherDropdown.tsx @@ -4,7 +4,7 @@ import { useRouter } from "next/router"; import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; import { handleSelect } from "./functions"; -function DropdownTeacher({ teachers }) { +function DropdownTeacher({ teachers }: { teachers: nameValueType[] }) { const [searchTeacher, setSearchTeacher] = useState(""); const [lastSelect, setLastSelect] = useState(""); const router = useRouter(); diff --git a/src/components/JumbotronLarge.tsx b/src/components/JumbotronLarge.tsx index 1a90fb6..77fc878 100644 --- a/src/components/JumbotronLarge.tsx +++ b/src/components/JumbotronLarge.tsx @@ -10,15 +10,21 @@ import Image from "next/legacy/image"; import Loading from "./Loading"; import Event from "./Event"; -function JumbotronLarge({ ...props }) { +function JumbotronLarge({ ...props }: props | null) { let { text = "", status, classes = [], teachers = [], rooms = [], - timeTable = {}, - } = props; + timeTable = { + hours: [], + generatedDate: "", + title: "", + validDate: "", + lessons: null, + }, + }: props = props; return (
diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index fc0ecbc..4a93e34 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -45,10 +45,14 @@ function Layout({ rooms = [], teachers = [], classes = [], - text = "", - siteTitle = "", - timeTable: { title = "" } = {}, - } = props; + timeTable = { + hours: [], + generatedDate: "", + title: "", + validDate: "", + lessons: null, + }, + }: props = props; useEffect(() => { initFlowbite(); @@ -58,10 +62,14 @@ function Layout({ <> - {`${siteTitle} ${siteTitle && "|"} ZSTiO - Plan lekcji`} + {`${timeTable.title} ${ + timeTable.title && "|" + } ZSTiO - Plan lekcji`}
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 2079398..a38100f 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -13,6 +13,12 @@ function Navbar({ isSnowing, setIsSnowing, inTimetable, +}: { + searchDialog: boolean; + setSearchDialog: React.Dispatch>; + isSnowing: boolean; + setIsSnowing: React.Dispatch>; + inTimetable: boolean; }) { const { theme, setTheme, resolvedTheme, systemTheme } = useTheme(); const [isMounted, setIsMounted] = useState(false); diff --git a/src/components/Navbar/ChangeButton.tsx b/src/components/Navbar/ChangeButton.tsx index dddead4..1445662 100644 --- a/src/components/Navbar/ChangeButton.tsx +++ b/src/components/Navbar/ChangeButton.tsx @@ -3,7 +3,7 @@ import { ArrowPathRoundedSquareIcon } from "@heroicons/react/24/outline"; import { useRouter } from "next/router"; import React from "react"; -function ChangeButton({ inTimetable }) { +function ChangeButton({ inTimetable }: { inTimetable: boolean }) { const router = useRouter(); return ( diff --git a/src/components/Navbar/SearchButton.tsx b/src/components/Navbar/SearchButton.tsx index 532de1d..ac7feff 100644 --- a/src/components/Navbar/SearchButton.tsx +++ b/src/components/Navbar/SearchButton.tsx @@ -1,7 +1,13 @@ import { MagnifyingGlassCircleIcon } from "@heroicons/react/24/outline"; import React from "react"; -function SearchButton({ searchDialog, setSearchDialog }) { +function SearchButton({ + searchDialog, + setSearchDialog, +}: { + searchDialog: boolean; + setSearchDialog: React.Dispatch>; +}) { return (