Skip to content

🎥 Make videos programmatically with React

click to watch video

Jonny Burger2f5882f749d8
diff --git a/packages/docs/components/LandingPage/PlayerPreview.tsx b/packages/docs/components/LandingPage/PlayerPreview.tsx
new file mode 100644
index 0000000000..49741b6023
--- /dev/null
+++ b/packages/docs/components/LandingPage/PlayerPreview.tsx
@@ -0,0 +1,36 @@
+import React from "react";
+import styled from "styled-components";
+
+const Container = styled.div`
+ display: flex;
+ flex: 1;
+ cursor: pointer;
+ position: relative;
+`;
+
+export const PlayerPreview: React.FC = () => {
+ return (
+ <a href="https://www.youtube.com/watch?v=gwlDorikqgY" target="_blank">
+ <Container>
+ <img
+ style={{
+ boxShadow: "0 0 8px rgba(0, 0, 0, 0.2)",
+ }}
+ src="http://i3.ytimg.com/vi/gwlDorikqgY/maxresdefault.jpg"
+ ></img>
+ <div
+ style={{
+ width: "100%",
+ textAlign: "center",
+ position: "absolute",
+ bottom: 20,
+ color: "black",
+ fontSize: 13,
+ }}
+ >
+ Watch 2 min video
+ </div>
+ </Container>
+ </a>
+ );
+};
diff --git a/packages/docs/components/LandingPage/WriteInReact.tsx b/packages/docs/components/LandingPage/WriteInReact.tsx
index 7afaf6b44e..f959a4fbcf 100644
--- a/packages/docs/components/LandingPage/WriteInReact.tsx
+++ b/packages/docs/components/LandingPage/WriteInReact.tsx
@@ -5,6 +5,7 @@ import styled from "styled-components";
import headerStyles from "../../src/pages/header.module.css";
import styles from "../../src/pages/styles.module.css";
import { mobile } from "../layout/layout";
+import { PlayerPreview } from "./PlayerPreview";
const Row = styled.div`
flex-direction: row;
@@ -86,12 +87,7 @@ export const WriteInReact: React.FC = () => {
</Tabs>
</div>
<Right>
- <img
- style={{
- boxShadow: "0 0 8px rgba(0, 0, 0, 0.2)",
- }}
- src="http://i3.ytimg.com/vi/gwlDorikqgY/maxresdefault.jpg"
- ></img>
+ <PlayerPreview />
</Right>
</Row>
);