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/share/edit/open-anonymously.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
import { useRouter } from "next/router";
7
import { Divider } from "antd";
8
import { Icon } from "@cocalc/frontend/components/icon";
9
import Try from "components/auth/try";
10
11
export default function OpenAnonymously({
12
publicPathId,
13
}: {
14
publicPathId?: string;
15
}) {
16
const router = useRouter();
17
return (
18
<div>
19
<Divider>
20
<Icon name="mask" style={{ marginRight: "10px" }} /> Anonymously
21
</Divider>
22
<Try
23
minimal
24
onSuccess={() =>
25
router.push({
26
pathname: router.asPath.split("?")[0],
27
query: { edit: "true" },
28
})
29
}
30
publicPathId={publicPathId}
31
/>
32
</div>
33
);
34
}
35
36