From ff450533b6f8f66cbd7cf46ac7b879e9ec8d2291 Mon Sep 17 00:00:00 2001 From: Lucid Kobold Date: Sun, 5 Dec 2021 20:55:06 -0600 Subject: [PATCH] Move heading to it's own component. --- components/calender/CalenderNav.tsx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/components/calender/CalenderNav.tsx b/components/calender/CalenderNav.tsx index 1aa5ccb..a01e89d 100644 --- a/components/calender/CalenderNav.tsx +++ b/components/calender/CalenderNav.tsx @@ -1,15 +1,14 @@ import React, { useContext } from "react"; import { useRouter } from "next/router"; -import { Heading, HStack, IconButton } from "@chakra-ui/react"; +import { HStack, IconButton } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import { sub, add, format } from "date-fns"; import { CalenderContext } from "../../contexts/CalenderContext"; +import DatePicker from "./DatePicker"; const CalenderNav = (): JSX.Element => { const { selectedDate } = useContext(CalenderContext); - const currentMonth = format(selectedDate, "LLLL uuuu"); - const router = useRouter(); const handleNavButtons = (direction: "next" | "prev") => { @@ -32,7 +31,7 @@ const CalenderNav = (): JSX.Element => { router.push(`/calendar/${year}/${month}`); } - } + }; return ( @@ -41,20 +40,11 @@ const CalenderNav = (): JSX.Element => { icon={} onClick={() => handleNavButtons("prev")} /> - - {currentMonth} - + } onClick={() => handleNavButtons("next")} - /> );