Dashboard

This commit is contained in:
rsandb
2023-01-03 22:43:21 -06:00
parent 66662d9f7a
commit ba2c4cbc0f
19 changed files with 526 additions and 146 deletions
-1
View File
@@ -51,7 +51,6 @@ export default function Account() {
</Button>
</InputGroup>
</form>
<p>{session.user.email}</p>
</main>
</>
);
+4 -3
View File
@@ -15,13 +15,13 @@ function Signin({ csrfToken, providers }) {
const emailEl = useRef(null);
const signinWithEmail = (ev: React.FormEvent) => {
ev.preventDefault();
signIn(email.id, { callbackUrl: "/", email: emailEl.current.value });
signIn(email.id, { callbackUrl: "/dashboard", email: emailEl.current.value });
};
const debugUsernameEl = useRef(null);
function signinWithDebugCredentials(ev: React.FormEvent) {
ev.preventDefault();
signIn(credentials.id, { callbackUrl: "/", username: debugUsernameEl.current.value });
signIn(credentials.id, { callbackUrl: "/dashboard", username: debugUsernameEl.current.value });
}
const { colorMode } = useColorMode();
@@ -98,7 +98,8 @@ function Signin({ csrfToken, providers }) {
</Button>
)}
</Stack>
<div className="pt-10 text-center">
<hr className="mt-14 mb-4 h-px bg-gray-200 border-0" />
<div className="text-center">
By signing up you agree to our <br></br>
<Link href="/terms-of-service" aria-label="Terms of Service" className="hover:underline underline-offset-4">
<b>Terms of Service</b>
+37
View File
@@ -0,0 +1,37 @@
import { Box, useColorMode } from "@chakra-ui/react";
import Head from "next/head";
import { Header } from "src/components/Header";
import { LeaderboardWidget, SideMenu, TaskOption } from "src/components/Widgets";
import { colors } from "styles/Theme/colors";
const Dashboard = () => {
const { colorMode } = useColorMode();
return (
<>
<Head>
<title>Dashboard - Open Assistant</title>
<meta name="description" content="Chat with Open Assistant and provide feedback." />
</Head>
<Box backgroundColor={colorMode === "light" ? colors.light.bg : colors.dark.bg} className="sm:overflow-hidden">
<Box className="sm:flex h-full gap-6">
<Box className="p-6 sm:pr-0">
<SideMenu />
</Box>
<Box className="flex flex-col overflow-auto p-6 sm:pl-0 gap-14">
<TaskOption />
<LeaderboardWidget />
</Box>
</Box>
</Box>
</>
);
};
Dashboard.getLayout = (page) => (
<div className="grid grid-rows-[min-content_1fr_min-content] h-full justify-items-stretch">
<Header transparent={true} />
{page}
</div>
);
export default Dashboard;
@@ -1,7 +1,9 @@
import { useColorMode } from "@chakra-ui/react";
import Head from "next/head";
import { useState } from "react";
import { ContextMessages } from "src/components/ContextMessages";
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
import { Message } from "src/components/Messages";
import { Sortable } from "src/components/Sortable/Sortable";
import { SurveyCard } from "src/components/Survey/SurveyCard";
import { TaskControls } from "src/components/Survey/TaskControls";
@@ -9,8 +11,6 @@ import fetcher from "src/lib/fetcher";
import poster from "src/lib/poster";
import useSWRImmutable from "swr/immutable";
import useSWRMutation from "swr/mutation";
import { Message } from "src/components/Messages";
import { ContextMessages } from "src/components/ContextMessages";
const RankUserReplies = () => {
const [tasks, setTasks] = useState([]);
+5 -15
View File
@@ -1,16 +1,10 @@
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 { getTransparentHeaderLayout } from "src/components/Layout";
import { TaskSelection } from "src/components/TaskSelection";
const Home = () => {
const { data: session } = useSession();
return (
<>
<Head>
@@ -20,15 +14,11 @@ const 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>
{session ? (
<TaskSelection />
) : (
<main className="oa-basic-theme">
<Hero />
<CallToAction />
<Faq />
</main>
)}
<main className="oa-basic-theme">
<Hero />
<CallToAction />
<Faq />
</main>
</>
);
};