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/components/share/layout.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { ReactNode } from "react";6import { join } from "path";7import { Layout as AntdLayout } from "antd";8import { SHARE_MAX_WIDTH } from "lib/config";9import Head from "next/head";10import Analytics from "components/analytics";11import Footer from "components/landing/footer";12import Header from "./header";13import basePath from "lib/base-path";14import useCustomize from "lib/use-customize";1516const favicon = join(basePath, "webapp/favicon-32x32.png");1718interface Props {19title: string;20top?: ReactNode;21children: ReactNode;22}2324export function Layout({ title, children, top }: Props) {25const { siteName, noindex } = useCustomize();26return (27<>28<Head>29<title>30{`${siteName} -- ${title}`}31</title>32<meta name="description" content="CoCalc Share Server" />33{noindex && <meta name="robots" content="noindex,nofollow" />}34<link rel="icon" href={favicon} />35</Head>36<AntdLayout>37<Header />38<AntdLayout.Content style={{ background: "white" }}>39{top}40<div41style={{42color: "#555",43margin: "0 auto",44maxWidth: SHARE_MAX_WIDTH,45fontSize: "11pt",46padding: "15px",47}}48>49{children}50</div>51</AntdLayout.Content>52<Footer />53</AntdLayout>54</>55);56}5758export function Embed({ title, children }: Props) {59const { siteName } = useCustomize();60return (61<>62<Head>63<title>64{`${siteName} -- ${title}`}65</title>66<link rel="icon" href={favicon} />67</Head>68<Analytics />69<main>{children}</main>70</>71);72}737475