Skip to content

Commit 81efe69

Browse files
committed
another live demo filter -- must have an account
1 parent 5d455c3 commit 81efe69

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

src/packages/next/components/landing/content.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { Col, Row, Space } from "antd";
77
import { ReactNode } from "react";
8-
98
import StaticMarkdown from "@cocalc/frontend/editors/slate/static-markdown";
109
import { COLORS } from "@cocalc/util/theme";
1110
import Path from "components/app/path";
@@ -74,7 +73,7 @@ export default function Content(props: Props) {
7473
title,
7574
} = props;
7675

77-
const { sandboxProjectId } = useCustomize();
76+
const { account, sandboxProjectId } = useCustomize();
7877

7978
function renderIndexInfo() {
8079
if (!imageAlternative) return;
@@ -218,13 +217,15 @@ export default function Content(props: Props) {
218217
{description}
219218
</Title>
220219
)}
221-
<div style={{ marginTop: "15px" }}>
222-
<LiveDemo
223-
context={
224-
typeof title == "string" ? title : alt ?? "Feature Page"
225-
}
226-
/>
227-
</div>
220+
{account && (
221+
<div style={{ marginTop: "15px" }}>
222+
<LiveDemo
223+
context={
224+
typeof title == "string" ? title : alt ?? "Feature Page"
225+
}
226+
/>
227+
</div>
228+
)}
228229
<SignIn startup={startup ?? title} hideFree={true} />
229230
</Space>
230231
</Col>

src/packages/next/components/landing/footer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default function Footer() {
6262
organizationURL,
6363
enabledPages,
6464
termsOfServiceURL,
65+
account,
6566
} = useCustomize();
6667

6768
const footerColumns: Array<FooterColumn> = [
@@ -136,7 +137,7 @@ export default function Footer() {
136137
{
137138
text: "Get a Live Demo",
138139
url: liveDemoUrl("footer"),
139-
hide: !enabledPages?.support,
140+
hide: !account || !enabledPages?.support,
140141
},
141142
],
142143
},

src/packages/next/components/landing/header.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import basePath from "lib/base-path";
1919
import { useCustomize } from "lib/customize";
2020
import SubNav, { Page, SubPage } from "./sub-nav";
2121
import LiveDemo from "components/landing/live-demo";
22-
// import { Button } from "antd";
23-
// import { Icon } from "@cocalc/frontend/components/icon";
22+
import { Button } from "antd";
23+
import { Icon } from "@cocalc/frontend/components/icon";
2424

2525
const GAP = "4%";
2626

@@ -71,14 +71,16 @@ export default function Header(props: Props) {
7171
width: "150px", // CRITICAL -- this is to prevent flicker -- see https://github.com/sagemathinc/cocalc/issues/6504
7272
}}
7373
>
74-
<LiveDemo context="header" />
75-
{/*<Button
76-
size="large"
77-
type="primary"
78-
href="/support/new?type=question&subject=&body=&title=Ask%20Us%20Anything!"
79-
>
80-
<Icon style={{ fontSize: "20px" }} name="question-circle" /> Contact
81-
</Button>*/}
74+
{account ? (
75+
<LiveDemo context="header" />
76+
) : (
77+
<Button
78+
type="primary"
79+
href="/support/new?type=question&subject=&body=&title=Ask%20Us%20Anything!"
80+
>
81+
<Icon name="question-circle" /> Contact
82+
</Button>
83+
)}
8284
</span>
8385
);
8486
}

0 commit comments

Comments
 (0)