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/components/account/config/anonymous/index.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
/*
7
The config page for anonymous users. An anonymous user *is* signed in using a full account.
8
This page does belong in configuration -- it's about taking the steps to convert their
9
anonymous account into a full account so they won't lose their work. Most important
10
is an email address or SSO sign on link.
11
12
Non-anonymous users get the layout page.
13
*/
14
import { Button, Popconfirm } from "antd";
15
16
import { Icon } from "@cocalc/frontend/components/icon";
17
import { Paragraph, Title } from "components/misc";
18
import SiteName from "components/share/site-name";
19
import apiPost from "lib/api/post";
20
import { useRouter } from "next/router";
21
import Upgrade from "./upgrade";
22
23
export default function Anonymous() {
24
const router = useRouter();
25
return (
26
<div
27
style={{
28
margin: "auto",
29
padding: "50px 30px",
30
maxWidth: "800px",
31
background: "white",
32
}}
33
>
34
<Popconfirm
35
title={
36
<div style={{ maxWidth: "50ex" }}>
37
Are you sure you want to sign out <b>losing everything</b> you just
38
did anonymously?
39
</div>
40
}
41
onConfirm={async () => {
42
await apiPost("/accounts/sign-out", { all: true });
43
router.push("/");
44
}}
45
okText={"Yes, discard everything"}
46
cancelText={"Cancel"}
47
>
48
<Button danger style={{ float: "right" }}>
49
<Icon name="sign-out-alt" /> Sign Out
50
</Button>
51
</Popconfirm>
52
<Title level={3}>
53
Thank you for trying <SiteName /> anonymously!
54
</Title>
55
<Paragraph>
56
Signing up for an account will prevent losing your work, and unlock
57
additional features.
58
</Paragraph>
59
<Upgrade style={{ margin: "15px 0px" }} />
60
</div>
61
);
62
}
63
64