From eec866b6072ae14a65c2c276591d45a451b41a3c Mon Sep 17 00:00:00 2001 From: shahanneda Date: Tue, 15 Feb 2022 03:38:24 -0500 Subject: [PATCH] cleaned up imports and comments --- components/WarningHeader.module.css | 5 +++-- components/WarningHeader.tsx | 22 ++++++---------------- content/warnings/warnings.json | 2 +- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/components/WarningHeader.module.css b/components/WarningHeader.module.css index aec6f52a..3b328615 100644 --- a/components/WarningHeader.module.css +++ b/components/WarningHeader.module.css @@ -6,6 +6,7 @@ text-align: center; opacity: 1; - max-height: 500px; /* just for smooth fade in purposes */ - transition: max-height 1000ms ease-in, padding 100ms ease-in; + /* The following are for a smooth fade in if there ever is a loading required for the warning, is not needed currently */ + /* max-height: 500px; + /* transition: max-height 1000ms ease-in, padding 100ms ease-in; */ } \ No newline at end of file diff --git a/components/WarningHeader.tsx b/components/WarningHeader.tsx index 752e376a..f4bf667c 100644 --- a/components/WarningHeader.tsx +++ b/components/WarningHeader.tsx @@ -1,11 +1,6 @@ -import { start } from "repl"; - import { parse } from "date-fns"; import { utcToZonedTime, zonedTimeToUtc } from "date-fns-tz"; -import { GetStaticProps } from "next"; -import React, { useState, useEffect } from "react"; - -import { getCurrentTerm } from "@/lib/events"; +import React from "react"; import warnings from "../content/warnings/warnings.json"; @@ -74,14 +69,9 @@ function getCurrentWarning(): Warning | null { export function WarningHeader() { const warning = getCurrentWarning(); - if (!warning || warning.message == "") { - return ( -
- ); - } - - return
{warning.message}
; + return !warning || warning.message == "" ? ( + <> + ) : ( +
{warning.message}
+ ); } diff --git a/content/warnings/warnings.json b/content/warnings/warnings.json index abf818a1..b85ca09a 100644 --- a/content/warnings/warnings.json +++ b/content/warnings/warnings.json @@ -1,7 +1,7 @@ [ { "startDate": "February 15 2022 00:00", - "endDate": "March 25 2022 18:00", + "endDate": "February 17 2022 18:00", "message": "This is test warning in FEB!" }, {