From 5091bce7fbef629ab7f287c4fd430ef243b37839 Mon Sep 17 00:00:00 2001 From: MarconLP <13001502+MarconLP@users.noreply.github.com> Date: Tue, 11 Apr 2023 21:27:11 +0200 Subject: [PATCH] add modal to new video button to explain how to upload videos --- package-lock.json | 24 +++++++++ package.json | 1 + src/components/VideoUploadModal.tsx | 81 +++++++++++++++++++++++++++++ src/pages/videos.tsx | 8 +-- 4 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 src/components/VideoUploadModal.tsx diff --git a/package-lock.json b/package-lock.json index 735286a..fcb3b29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@aws-sdk/client-s3": "^3.310.0", "@aws-sdk/s3-request-presigner": "^3.310.0", + "@headlessui/react": "^1.7.13", "@next-auth/prisma-adapter": "^1.0.5", "@prisma/client": "^4.11.0", "@tanstack/react-query": "^4.28.0", @@ -1429,6 +1430,21 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@headlessui/react": { + "version": "1.7.13", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.13.tgz", + "integrity": "sha512-9n+EQKRtD9266xIHXdY5MfiXPDfYwl7zBM7KOx2Ae3Gdgxy8QML1FkCMjq6AsOf0l6N9uvI4HcFtuFlenaldKg==", + "dependencies": { + "client-only": "^0.0.1" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^16 || ^17 || ^18", + "react-dom": "^16 || ^17 || ^18" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -7346,6 +7362,14 @@ "integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g==", "dev": true }, + "@headlessui/react": { + "version": "1.7.13", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.13.tgz", + "integrity": "sha512-9n+EQKRtD9266xIHXdY5MfiXPDfYwl7zBM7KOx2Ae3Gdgxy8QML1FkCMjq6AsOf0l6N9uvI4HcFtuFlenaldKg==", + "requires": { + "client-only": "^0.0.1" + } + }, "@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", diff --git a/package.json b/package.json index e71b3ca..73c98e7 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@aws-sdk/client-s3": "^3.310.0", "@aws-sdk/s3-request-presigner": "^3.310.0", + "@headlessui/react": "^1.7.13", "@next-auth/prisma-adapter": "^1.0.5", "@prisma/client": "^4.11.0", "@tanstack/react-query": "^4.28.0", diff --git a/src/components/VideoUploadModal.tsx b/src/components/VideoUploadModal.tsx new file mode 100644 index 0000000..22a831c --- /dev/null +++ b/src/components/VideoUploadModal.tsx @@ -0,0 +1,81 @@ +import { Fragment, useState } from "react"; +import { Dialog, Transition } from "@headlessui/react"; + +export default function VideoUploadModal() { + const [isOpen, setIsOpen] = useState(false); + + function closeModal() { + setIsOpen(false); + } + + function openModal() { + setIsOpen(true); + } + + return ( + <> + + New video + + + + + +
+ + +
+
+ + + + Install the extension + +
+

+ You have to install the screenity extension from the + Chrome Store. At the end of the recording you will be able + to upload the video. +

+
+ +
+ +
+
+
+
+
+
+
+ + ); +} diff --git a/src/pages/videos.tsx b/src/pages/videos.tsx index 9aeb2ef..3bc76d6 100644 --- a/src/pages/videos.tsx +++ b/src/pages/videos.tsx @@ -6,6 +6,7 @@ import Link from "next/link"; import { useSession } from "next-auth/react"; import { useRouter } from "next/router"; import Image from "next/image"; +import VideoUploadModal from "~/components/VideoUploadModal"; const VideoList: NextPage = () => { const router = useRouter(); @@ -33,12 +34,7 @@ const VideoList: NextPage = () => {
Screenity
- - New video - +