Skip to content

Commit 7fd6b95

Browse files
committed
next/support: use "supportVideoCall" in various places, rearrangements, etc.
1 parent 727bfec commit 7fd6b95

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

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

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

6868
const footerColumns: Array<FooterColumn> = [
@@ -140,8 +140,13 @@ export default function Footer() {
140140
},
141141
{
142142
text: "Get a Live Demo",
143+
url: supportVideoCall,
144+
hide: !enabledPages?.liveDemo || !supportVideoCall,
145+
},
146+
{
147+
text: "Contact Us",
143148
url: liveDemoUrl("footer"),
144-
hide: !account || !enabledPages?.liveDemo,
149+
hide: !enabledPages?.support,
145150
},
146151
],
147152
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default function Header(props: Props) {
7272
}}
7373
>
7474
{true || account ? (
75-
<LiveDemo context="header" type="primary" />
75+
<LiveDemo context="header" btnType="primary" />
7676
) : (
7777
<Button
7878
type="primary"
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { Button } from "antd";
2-
import { useEffect, useState } from "react";
2+
import type { ButtonType } from "antd/es/button";
3+
import type { ReactNode } from "react";
34

45
import { Icon } from "@cocalc/frontend/components/icon";
56
import getSupportUrl from "@cocalc/frontend/support/url";
7+
import { useCustomize } from "lib/customize";
68

79
export function liveDemoUrl(context) {
810
return getSupportUrl({
@@ -15,18 +17,20 @@ export function liveDemoUrl(context) {
1517

1618
interface Props {
1719
context: string;
18-
label?;
19-
type?;
20+
label?: string | ReactNode;
21+
btnType?: ButtonType;
2022
}
2123

22-
export default function LiveDemo({ context, label, type }: Props) {
23-
const [href, setHref] = useState<string | undefined>(undefined);
24-
useEffect(() => {
25-
setHref(liveDemoUrl(context));
26-
}, []);
24+
export default function LiveDemo({ label, btnType }: Props) {
25+
const { supportVideoCall } = useCustomize();
26+
27+
if (!supportVideoCall) {
28+
return null;
29+
}
30+
2731
return (
28-
<Button href={href} type={type}>
29-
<Icon name="users" /> {label ?? "Contact Us!"}
32+
<Button href={supportVideoCall} type={btnType}>
33+
<Icon name="video-camera" /> {label ?? "Book a Demo!"}
3034
</Button>
3135
);
3236
}

src/packages/next/components/landing/sign-in.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useRouter } from "next/router";
88
import { join } from "path";
99
import { CSSProperties, ReactNode } from "react";
1010

11+
import { Icon } from "@cocalc/frontend/components/icon";
1112
import SSO from "components/auth/sso";
1213
import { Paragraph } from "components/misc";
1314
import basePath from "lib/base-path";
@@ -39,6 +40,7 @@ export default function SignIn({ startup, hideFree, style, emphasize }: Props) {
3940
onClick={() => (window.location.href = join(basePath, "projects"))}
4041
title={`Open the ${siteName} app and view your projects.`}
4142
type="primary"
43+
icon={<Icon name="edit" />}
4244
>
4345
Your {siteName} Projects
4446
</Button>

src/packages/next/lib/with-customize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default async function withCustomize(
105105
systemActivity: true,
106106
status: customize.onCoCalcCom,
107107
termsOfService: !customize.landingPages && !!customize.termsOfServiceURL,
108-
liveDemo: customize.isCommercial,
108+
liveDemo: !!customize.supportVideoCall && customize.isCommercial,
109109
};
110110

111111
if (obj == null) {

0 commit comments

Comments
 (0)