Path: blob/master/src/packages/next/components/share/layout.tsx
1449 views
/*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>{`${siteName} -- ${title}`}</title>30<meta name="description" content="CoCalc Share Server" />31{noindex && <meta name="robots" content="noindex,nofollow" />}32<link rel="icon" href={favicon} />33</Head>34<AntdLayout>35<Header />36<AntdLayout.Content style={{ background: "white" }}>37{top}38<div39style={{40color: "#555",41margin: "0 auto",42maxWidth: SHARE_MAX_WIDTH,43fontSize: "11pt",44}}45>46{children}47</div>48</AntdLayout.Content>49<Footer />50</AntdLayout>51</>52);53}5455export function Embed({ title, children }: Props) {56const { siteName } = useCustomize();57return (58<>59<Head>60<title>{`${siteName} -- ${title}`}</title>61<link rel="icon" href={favicon} />62</Head>63<Analytics />64<main>{children}</main>65</>66);67}686970