From 1457d81e6b979280cbeb7fffa444a109b21a2c73 Mon Sep 17 00:00:00 2001 From: rsandb Date: Mon, 16 Jan 2023 16:34:11 -0600 Subject: [PATCH] added SlimFooter component for dashboard, made original footer mobile-friendly --- .../src/components/Dashboard/SlimFooter.tsx | 45 +++++++++++ website/src/components/Footer.tsx | 81 +++++++++++++------ website/src/components/Layout.tsx | 14 +++- website/src/components/SideMenuLayout.tsx | 6 +- website/src/pages/dashboard.tsx | 7 +- 5 files changed, 121 insertions(+), 32 deletions(-) create mode 100644 website/src/components/Dashboard/SlimFooter.tsx diff --git a/website/src/components/Dashboard/SlimFooter.tsx b/website/src/components/Dashboard/SlimFooter.tsx new file mode 100644 index 00000000..5a7b093c --- /dev/null +++ b/website/src/components/Dashboard/SlimFooter.tsx @@ -0,0 +1,45 @@ +import { Box, Divider } from "@chakra-ui/react"; +import Image from "next/image"; +import Link from "next/link"; +import { useMemo } from "react"; + +export function SlimFooter() { + return ( + + ); +} + +const FooterLink = ({ href, label }: { href: string; label: string }) => + useMemo( + () => ( + + {label} + + ), + [href, label] + ); diff --git a/website/src/components/Footer.tsx b/website/src/components/Footer.tsx index 39480473..b22653e9 100644 --- a/website/src/components/Footer.tsx +++ b/website/src/components/Footer.tsx @@ -1,26 +1,65 @@ -import { Box, Divider } from "@chakra-ui/react"; +import { Box, Divider, Flex, Text, useColorMode } from "@chakra-ui/react"; import Image from "next/image"; import Link from "next/link"; import { useMemo } from "react"; export function Footer() { + const { colorMode } = useColorMode(); + const backgroundColor = colorMode === "light" ? "white" : "gray.800"; + const textColor = colorMode === "light" ? "black" : "gray.300"; + return ( ); @@ -29,14 +68,10 @@ export function Footer() { const FooterLink = ({ href, label }: { href: string; label: string }) => useMemo( () => ( - - {label} + + + {label} + ), [href, label] diff --git a/website/src/components/Layout.tsx b/website/src/components/Layout.tsx index b94124a6..70a2ce2c 100644 --- a/website/src/components/Layout.tsx +++ b/website/src/components/Layout.tsx @@ -1,9 +1,11 @@ // https://nextjs.org/docs/basic-features/layouts +import { Box, Grid } from "@chakra-ui/react"; import type { NextPage } from "next"; import { FiBarChart2, FiLayout, FiMessageSquare, FiUsers } from "react-icons/fi"; import { Header } from "src/components/Header"; +import { SlimFooter } from "./Dashboard/SlimFooter"; import { Footer } from "./Footer"; import { SideMenuLayout } from "./SideMenuLayout"; @@ -28,7 +30,7 @@ export const getTransparentHeaderLayout = (page: React.ReactElement) => ( ); export const getDashboardLayout = (page: React.ReactElement) => ( -
+
( }, ]} > - {page} -
+ + {page} + + + + -
+ ); export const getAdminLayout = (page: React.ReactElement) => ( diff --git a/website/src/components/SideMenuLayout.tsx b/website/src/components/SideMenuLayout.tsx index a768bc85..1e92a0c7 100644 --- a/website/src/components/SideMenuLayout.tsx +++ b/website/src/components/SideMenuLayout.tsx @@ -12,11 +12,11 @@ export const SideMenuLayout = (props: SideMenuLayoutProps) => { return ( - - + + - {props.children} + {props.children} ); diff --git a/website/src/pages/dashboard.tsx b/website/src/pages/dashboard.tsx index 42481f1e..3971e125 100644 --- a/website/src/pages/dashboard.tsx +++ b/website/src/pages/dashboard.tsx @@ -1,3 +1,4 @@ +import { Flex } from "@chakra-ui/react"; import Head from "next/head"; import { useSession } from "next-auth/react"; import { LeaderboardTable, TaskOption } from "src/components/Dashboard"; @@ -16,8 +17,10 @@ const Dashboard = () => { Dashboard - Open Assistant - - + + + + ); };