From f534def85d3169748dd934b095b956a0b3515253 Mon Sep 17 00:00:00 2001 From: rsandb Date: Wed, 28 Dec 2022 12:21:17 -0600 Subject: [PATCH] fixed merge issues --- website/src/middleware.ts | 2 +- website/src/pages/_app.tsx | 16 +++++++++--- website/src/pages/index.tsx | 49 ++++++++++++++----------------------- 3 files changed, 31 insertions(+), 36 deletions(-) diff --git a/website/src/middleware.ts b/website/src/middleware.ts index fdaa071c..31c2cb4e 100644 --- a/website/src/middleware.ts +++ b/website/src/middleware.ts @@ -4,5 +4,5 @@ export { default } from "next-auth/middleware"; * Guards all pages under `/grading` and redirects them to the sign in page. */ export const config = { - matcher: ["/grading/:path*", "/account/:path*", "/summarize/:path*"], + matcher: ["/create/:path*", "/evaluate/:path*", "/grading/:path*", "/account/:path*", "/summarize/:path*"], }; diff --git a/website/src/pages/_app.tsx b/website/src/pages/_app.tsx index c4463d00..7deebc4b 100644 --- a/website/src/pages/_app.tsx +++ b/website/src/pages/_app.tsx @@ -2,6 +2,9 @@ import { ChakraProvider } from "@chakra-ui/react"; import { SessionProvider } from "next-auth/react"; import { Inter } from "@next/font/google"; import { extendTheme } from "@chakra-ui/react"; +import type { AppProps } from "next/app"; + +import { getDefaultLayout, NextPageWithLayout } from "src/components/Layout"; import "../styles/globals.css"; import "focus-visible"; @@ -27,12 +30,17 @@ const theme = extendTheme({ }, }); -function MyApp({ Component, pageProps: { session, ...pageProps } }) { +type AppPropsWithLayout = AppProps & { + Component: NextPageWithLayout; +}; + +function MyApp({ Component, pageProps: { session, ...pageProps } }: AppPropsWithLayout) { + const getLayout = Component.getLayout ?? getDefaultLayout; + const page = getLayout(); + return ( - - - + {page} ); } diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 239fe2ff..c829ae0c 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -1,36 +1,14 @@ -import { useSession } from "next-auth/react"; import Head from "next/head"; +import { useSession } from "next-auth/react"; + import { CallToAction } from "src/components/CallToAction"; import { Faq } from "src/components/Faq"; -import { Footer } from "src/components/Footer"; -import { Header } from "src/components/Header"; import { Hero } from "src/components/Hero"; import { TaskSelection } from "src/components/TaskSelection"; -export default function Home() { +const Home = () => { const { data: session } = useSession(); - if (!session) { - return ( - <> - - Open Assistant - - -
-
- - - - -
-