CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/share/customize.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
export { useCustomize } from "lib/customize";
7
import { Customize as CustomizeContext, CustomizeType } from "lib/customize";
8
import Link from "next/link";
9
10
export function Customize({
11
value,
12
children,
13
}: {
14
value: CustomizeType;
15
children;
16
}) {
17
if (!value.shareServer) {
18
return <ShareServerIsDisabled value={value} />;
19
}
20
return <CustomizeContext value={value}>{children}</CustomizeContext>;
21
}
22
23
function ShareServerIsDisabled({ value }: { value: CustomizeType }) {
24
const { siteName, helpEmail } = value;
25
return (
26
<div style={{ margin: "30px", fontSize: "12pt" }}>
27
<h1>
28
Browsing of publicly shared paths is currently disabled on{" "}
29
<Link href="/">{siteName ?? "this server"}</Link>.
30
</h1>
31
<br />
32
{helpEmail && (
33
<div>
34
Contact <a href={`mailto:${helpEmail}`}>{helpEmail}</a> for help.
35
</div>
36
)}
37
</div>
38
);
39
}
40
41