Warning Header (Closes #205) #394

Merged
snedadah merged 19 commits from warning-header into main 2022-02-22 23:29:55 -05:00
4 changed files with 27 additions and 0 deletions
Showing only changes of commit a3cc1533ab - Show all commits

View File

@ -0,0 +1,7 @@
.warning{
background-color: var(--warning-background);
padding: calc(5rem / 16);
color: var(--primary-accent-light);
font-size: calc(15rem / 16);
text-align: center;
}

View File

@ -0,0 +1,17 @@
import { GetStaticProps } from "next";
import { getCurrentWarning, Warning } from "pages/api/warnings";
import React from "react";
import { getCurrentTerm } from "@/lib/events";
import styles from "./WarningHeader.module.css";
export function WarningHeader() {
snedadah marked this conversation as resolved
Review

We should probably move these functions to utils in that case, and then make both events and this file import from there

We should probably move these functions to utils in that case, and then make both events and this file import from there
// We can't use getStaticProps since its a component, and we can't put it getStaticProps in its parents because nextjs doesnt support it in the _app.js
return (
<div className={styles.warning}>
Warning: The computers will be down for a scheduled maintenance unitl Jan
28, 2021.
</div>
);
}

View File

@ -22,6 +22,7 @@ body {
--text: #000000;
--form-invalid: #9f616a;
--warning-background: #dd0014;
snedadah marked this conversation as resolved
Review

Make sure to add these colors in our theme palette as well. That way it will show up in the themer and will be totally customizable!

Themer: https://csclub.uwaterloo.ca/themer

Adding a color to the palette should be as easy as adding a string to this array. If that doesn't work, let me know and we can figure something out.

Make sure to add these colors in our theme palette as well. That way it will show up in the themer and will be totally customizable! Themer: https://csclub.uwaterloo.ca/themer Adding a color to the palette should be as easy as adding a string to [this array](https://git.csclub.uwaterloo.ca/www/www-new/src/branch/main/components/Theme.tsx#L18). If that doesn't work, let me know and we can figure something out.
--input-background: #f0f0f0;
--input-placeholder-text: #bbbbbb;

View File

@ -20,6 +20,7 @@ import {
} from "@/components/ShapesBackground";
import { Table } from "@/components/Table";
import { ThemeProvider } from "@/components/Theme";
import { WarningHeader } from "@/components/WarningHeader";
import styles from "./_app.module.css";
@ -44,6 +45,7 @@ export default function App({ Component, pageProps }: AppProps): JSX.Element {
}}
>
<div className={styles.appContainer}>
<WarningHeader />
<Navbar />
{/* Wrapping content with a div to allow for a display: block parent */}
<div className={styles.contentContainer}>