Skip to content

🎥 Make videos programmatically with React

cancel button

Jonny Burger6f53490b2b41
diff --git a/packages/docs/src/components/VideoPlayer.tsx b/packages/docs/src/components/VideoPlayer.tsx
index ab7cff1200..c871121a38 100644
--- a/packages/docs/src/components/VideoPlayer.tsx
+++ b/packages/docs/src/components/VideoPlayer.tsx
@@ -1,7 +1,7 @@
import React, { useEffect, useMemo, useRef } from "react";
import { ShowcaseVideo } from "../data/showcase-videos";
import { useElementSize } from "../helpers/use-el-size";
-import { IconLeft, IconRight } from "../icons/arrows";
+import { CancelIcon, IconLeft, IconRight } from "../icons/arrows";
import { VideoPlayerContent } from "./VideoPlayerContent";
import { VidPlayerHeader } from "./VideoPlayerHeader";
@@ -36,6 +36,18 @@ const icon: React.CSSProperties = {
color: "white",
};
+const cancelContainer: React.CSSProperties = {
+ left: 16,
+ top: 16,
+ position: "absolute",
+};
+
+const cancelIcon: React.CSSProperties = {
+ width: 20,
+ color: "white",
+ cursor: "pointer",
+};
+
export const VideoPlayer: React.FC<{
video: ShowcaseVideo | null;
dismiss: () => void;
@@ -160,6 +172,11 @@ export const VideoPlayer: React.FC<{
return (
<div ref={outside} style={containerWithDirection}>
+ {mobileLayout ? null : (
+ <div style={cancelContainer}>
+ <CancelIcon style={cancelIcon} />
+ </div>
+ )}
{mobileLayout ? null : (
<div
ref={backButton}