Skip to content

Commit fc43c87

Browse files
committed
add support video embed
1 parent 75e632c commit fc43c87

File tree

3 files changed

+57
-36
lines changed

3 files changed

+57
-36
lines changed

src/packages/next/components/support/create.tsx

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import getBrowserInfo from "./browser-info";
2626
import RecentFiles from "./recent-files";
2727
import { Type } from "./tickets";
2828
import { NoZendesk } from "./util";
29+
import { VideoItem } from "components/videos";
2930

3031
const CHATGPT_DISABLED = true;
3132
const MIN_BODY_LENGTH = 16;
@@ -140,23 +141,30 @@ export default function Create() {
140141
</Title>
141142
{showExtra && (
142143
<>
143-
<p style={{ fontSize: "12pt" }}>
144-
Create a new support ticket below or{" "}
145-
<A href="/support/tickets">
146-
check the status of your support tickets
147-
</A>
148-
.{" "}
149-
{helpEmail ? (
150-
<>
151-
You can also email us directly at{" "}
152-
<A href={`mailto:${helpEmail}`}>{helpEmail}</A> or{" "}
153-
<A href="https://calendly.com/cocalc/discovery">
154-
book a demo or discovery call
155-
</A>
156-
.
157-
</>
158-
) : undefined}
159-
</p>
144+
<Space>
145+
<p style={{ fontSize: "12pt" }}>
146+
Create a new support ticket below or{" "}
147+
<A href="/support/tickets">
148+
check the status of your support tickets
149+
</A>
150+
.{" "}
151+
{helpEmail ? (
152+
<>
153+
You can also email us directly at{" "}
154+
<A href={`mailto:${helpEmail}`}>{helpEmail}</A> or{" "}
155+
<A href="https://calendly.com/cocalc/discovery">
156+
book a demo or discovery call
157+
</A>
158+
.
159+
</>
160+
) : undefined}
161+
</p>
162+
<VideoItem
163+
width={600}
164+
style={{ margin: "15px 0", width: "600px" }}
165+
id={"4Ef9sxX59XM"}
166+
/>
167+
</Space>
160168
{openaiEnabled && onCoCalcCom && !CHATGPT_DISABLED ? (
161169
<ChatGPT siteName={siteName} />
162170
) : undefined}

src/packages/next/components/videos.tsx

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,47 @@ export default function Videos({ videos }: { videos: Readonly<Video[]> }) {
3434
);
3535
}
3636

37-
function VideoItem({
37+
export function VideoItem({
3838
id,
3939
title,
40-
number,
41-
current,
40+
number = 0,
41+
current = 0,
42+
style,
43+
width = 672,
4244
}: {
4345
id: string;
44-
title: string;
46+
title?: string;
4547
number: number;
4648
current: number;
49+
style?;
50+
width?: number;
4751
}) {
4852
return (
49-
<div>
53+
<div style={style}>
5054
<div
5155
style={{
5256
background: "black",
5357
paddingBottom: "30px",
5458
paddingTop: "5px",
5559
}}
5660
>
57-
<A style={{ color: "white" }} href={`https://youtu.be/${id}`}>
58-
<Icon name="youtube" style={{ color: "red" }} /> {title}
59-
</A>
60-
<iframe
61-
style={{ marginTop: "30px", maxWidth: "100%" }}
62-
width="672"
63-
height="378"
64-
src={`https://www.youtube.com/embed/${current == number ? id : ""}`}
65-
title="YouTube video player"
66-
frameBorder={0}
67-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
68-
allowFullScreen
69-
></iframe>
61+
{title && (
62+
<A style={{ color: "white" }} href={`https://youtu.be/${id}`}>
63+
<Icon name="youtube" style={{ color: "red" }} /> {title}
64+
</A>
65+
)}
66+
<div style={{ textAlign: "center" }}>
67+
<iframe
68+
style={{ marginTop: "30px", maxWidth: "100%" }}
69+
width={width}
70+
height={(width * 9) / 16}
71+
src={`https://www.youtube.com/embed/${current == number ? id : ""}`}
72+
title="YouTube video player"
73+
frameBorder={0}
74+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
75+
allowFullScreen
76+
></iframe>
77+
</div>
7078
<A
7179
style={{ color: "white", float: "right", marginRight: "10px" }}
7280
href="https://www.youtube.com/@cocalc-cloud"

src/packages/next/pages/support/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import A from "components/misc/A";
77
import ChatGPTHelp from "components/openai/chatgpt-help";
88
import { Customize } from "lib/customize";
99
import withCustomize from "lib/with-customize";
10-
10+
import { VideoItem } from "components/videos";
1111
import IndexList, { DataSource } from "components/landing/index-list";
1212
import { Title } from "components/misc";
1313
import SanitizedMarkdown from "components/misc/sanitized-markdown";
@@ -26,6 +26,11 @@ const dataSource = [
2626
</A>
2727
. You do NOT have to be a paying customer to open a ticket, though we
2828
prioritize customer requests.
29+
<VideoItem
30+
width={800}
31+
style={{ margin: "15px 0" }}
32+
id={"4Ef9sxX59XM"}
33+
/>
2934
</>
3035
),
3136
},

0 commit comments

Comments
 (0)