mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-20 12:10:50 +08:00
fixed merge issues
This commit is contained in:
@@ -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*"],
|
||||
};
|
||||
|
||||
@@ -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(<Component {...pageProps} />);
|
||||
|
||||
return (
|
||||
<ChakraProvider theme={theme}>
|
||||
<SessionProvider session={pageProps.session}>
|
||||
<Component {...pageProps} />
|
||||
</SessionProvider>
|
||||
<SessionProvider session={pageProps.session}>{page}</SessionProvider>
|
||||
</ChakraProvider>
|
||||
);
|
||||
}
|
||||
|
||||
+18
-31
@@ -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 (
|
||||
<>
|
||||
<Head>
|
||||
<title>Open Assistant</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Conversational AI for everyone. An open source project to create a chat enabled GPT LLM run by LAION and contributors around the world."
|
||||
/>
|
||||
</Head>
|
||||
<Header />
|
||||
<main className="z-0">
|
||||
<Hero />
|
||||
<CallToAction />
|
||||
|
||||
<Faq />
|
||||
</main>
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -40,11 +18,20 @@ export default function Home() {
|
||||
content="Conversational AI for everyone. An open source project to create a chat enabled GPT LLM run by LAION and contributors around the world."
|
||||
/>
|
||||
</Head>
|
||||
<Header />
|
||||
<main className="m-20 z-0 bg-white flex flex-col items-center justify-center gap-2">
|
||||
<TaskSelection />
|
||||
</main>
|
||||
<Footer />
|
||||
{session ? (
|
||||
<main className="my-4">
|
||||
<TaskSelection />
|
||||
</main>
|
||||
) : (
|
||||
<main>
|
||||
<Hero />
|
||||
<CallToAction />
|
||||
|
||||
<Faq />
|
||||
</main>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Home;
|
||||
|
||||
Reference in New Issue
Block a user