From 20cebcc56676fee7d01a82541fcd9d99f76b857f Mon Sep 17 00:00:00 2001 From: menthy-wu Date: Wed, 10 Jan 2024 08:21:11 -0800 Subject: [PATCH] remove event page --- src/app/events/page.js | 50 ------------------------------------------ src/data/navigation.js | 6 +---- 2 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 src/app/events/page.js diff --git a/src/app/events/page.js b/src/app/events/page.js deleted file mode 100644 index e9a085c..0000000 --- a/src/app/events/page.js +++ /dev/null @@ -1,50 +0,0 @@ -"use client"; -import EventDescriptions from "@/components/events/EventDescriptions"; -import CalendarEvent from "@/components/events/Calendar"; -import { useState, useEffect } from "react"; -import axios from "axios"; - -const EvnetsPage = () => { - const [events, setEvents] = useState([]); - useEffect(() => { - axios - .get( - `https://www.googleapis.com/calendar/v3/calendars/${ - process.env.NEXT_PUBLIC_CALENDAR_ID - }/events?key=${ - process.env.NEXT_PUBLIC_GOOGLE_CALENDAR_API_KEY - }&singleEvents=true&orderBy=starttime&timeMin=${new Date( - new Date().getFullYear(), - new Date().getMonth(), - 1 - ).toISOString()}&timeMax=${new Date( - new Date().getMonth() === 11 - ? new Date().getFullYear() + 1 - : new Date().getFullYear(), - new Date().getMonth() === 11 ? 0 : new Date().getMonth() + 1, - 1 - ).toISOString()}` - ) - .then((result) => { - setEvents( - result.data.items.map((event) => ({ - ...event, - allDay: event.start.dateTime ? false : true, - start: event.start.dateTime - ? new Date(event.start.dateTime) - : new Date(event.start.date + "T00:00:00-07:00"), - end: new Date(event.end.dateTime || event.end.date), - color: "green", - })) - ); - }); - }, []); - return ( - <> - - - - ); -}; - -export default EvnetsPage; diff --git a/src/data/navigation.js b/src/data/navigation.js index 6f4313f..1f3442c 100644 --- a/src/data/navigation.js +++ b/src/data/navigation.js @@ -18,11 +18,7 @@ export const navigation = [ { name: "Air Quality System", link: "/air-quality-system" }, ], }, - { - name: "EVENTS", - link: "/events", - sub: [], - }, + { name: "BOARD", link: "/board",