This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Head from "next/head"; | |
import React, { useState } from "react"; | |
import { MemoizedVideoPlayer } from "../component/video-player"; | |
import styles from "../styles/Home.module.css"; | |
const Home = () => { | |
const [startTime, setStartTime] = useState(1633538276355); | |
const [controls, setControls] = useState(true); | |
const [ended, setEnded] = useState(false); | |
const [duration, setDuration] = useState(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import router from "next/router"; | |
export default function Checkout() { | |
return ( | |
<div | |
style={{ | |
display: "flex", | |
justifyContent: "center", | |
}} | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import { Helmet } from "react-helmet"; | |
import TransformVideo from "../components/video"; | |
const App = () => { | |
const [videoPublicId, setVideoPublicId] = useState(""); | |
const [alt, setAlt] = useState(""); | |
const [audioPublicId, setAudioPublicId] = useState(""); | |
const [textValue, setTextValue] = useState(" "); | |
const [color, setColor] = useState("green"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = [ | |
{ | |
id: "forest_bike", | |
name: "Forest Bike", | |
imageUrl: | |
"https://res.cloudinary.com/dwbggi96z/image/upload/v1622914696/0efbcdf473436391b6a5a731a000fadc_rs6z0z.jpg", | |
price: "$400", | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sea_turtle = { | |
shoppable: { | |
showPostPlayOverlay: true, | |
transformation: { | |
crop: "pad", | |
aspect_ratio: "1", | |
}, | |
products: [ | |
{ | |
productId: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var forest_bike = { | |
shoppable: { | |
showPostPlayOverlay: true, | |
transformation: { | |
crop: "pad", | |
aspect_ratio: "1", | |
}, | |
products: [ | |
{ | |
productId: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rafting = { | |
shoppable: { | |
transformation: { | |
crop: "pad", | |
aspect_ratio: "1", | |
}, | |
products: [ | |
{ | |
productId: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// New string | |
const words = "the house, the car, the book, the mac and the cheese" | |
// Specify search item | |
const searchTerm = "the" | |
// Search the string | |
let lastIndexOfWord = words.lastIndexOf(searchTerm) | |
// Display last index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// List of names | |
const names = "sean, becky, liz, wale, blue, becky, john" | |
const searchItem = "becky" | |
// Find last occurrence of "becky" | |
const lastSimilarName = names.lastIndexOf(searchItem) | |
// Display result | |
console.log(lastSimilarName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a string | |
const email = 'hello@john.com is my email, but i also use sign@john.com or help@sweets.com'; | |
// Create a regex to match all email | |
const re = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi; | |
// Find emails in string | |
const matches = email.match(re); | |
// Display output |