Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/pages/auth/try.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Layout } from "antd";6import Try from "components/auth/try";7import Footer from "components/landing/footer";8import Head from "components/landing/head";9import Header from "components/landing/header";10import basePath from "lib/base-path";11import { Customize } from "lib/customize";12import withCustomize from "lib/with-customize";13import { useRouter } from "next/router";1415export default function Home({ customize }) {16const { siteName } = customize;17const router = useRouter();18return (19<Customize value={customize}>20<Head title={`Try ${siteName} Now!`} />21<Layout>22<Header page="try" />23<Layout.Content style={{ backgroundColor: "white" }}>24<Try onSuccess={() => router.push("/")} />25<Footer />26</Layout.Content>27</Layout>28</Customize>29);30}3132export async function getServerSideProps(context) {33const customize = await withCustomize({ context });34if (customize.props.customize.account != null) {35// user is already signed in -- redirect them to top level page for now (todo).36const { res } = context;37res.writeHead(302, { location: basePath });38res.end();39return { props: { customize: {} } };40}41return customize;42}434445