diff --git a/src/components/ModernSwitch.tsx b/src/components/ModernSwitch.tsx new file mode 100644 index 0000000..2d802b0 --- /dev/null +++ b/src/components/ModernSwitch.tsx @@ -0,0 +1,25 @@ +import { Switch } from "@headlessui/react"; + +interface Props { + enabled: boolean; + toggle: () => void; +} + +export function ModernSwitch({ enabled, toggle }: Props) { + return ( + + + + ); +} diff --git a/src/components/ShareModal.tsx b/src/components/ShareModal.tsx new file mode 100644 index 0000000..34cebca --- /dev/null +++ b/src/components/ShareModal.tsx @@ -0,0 +1,98 @@ +import { Dialog, Switch, Transition } from "@headlessui/react"; +import { Fragment, useState } from "react"; +import { ModernSwitch } from "~/components/ModernSwitch"; + +export function ShareModal() { + const [open, setOpen] = useState(false); + + const [sharing, setSharing] = useState(false); + const [es, sses] = useState(false); + const [as, ssgs] = useState(false); + + const [s, ss] = useState(false); + + return ( + <> + setOpen(true)} + className="cursor-pointer rounded border border-[#0000001a] px-2 py-2 text-sm text-[#292d34] hover:bg-[#fafbfc]" + > + Share + + + + setOpen(false)} + > + + + + + + + + + + + Share this recording + + + + Share link with anyone + + + + + Copy public link + + + + Expire link + + + Never expire + + + + Delete video when expired + + + + Share link with search engines + + + + Embed code + + Copy code + + + + + + + + + + + > + ); +} diff --git a/src/pages/share/[videoId].tsx b/src/pages/share/[videoId].tsx index 1e6b4d2..530cf6b 100644 --- a/src/pages/share/[videoId].tsx +++ b/src/pages/share/[videoId].tsx @@ -7,6 +7,7 @@ import { useRouter } from "next/router"; import Link from "next/link"; import Image from "next/image"; import { getTime } from "~/utils/getTime"; +import { ShareModal } from "~/components/ShareModal"; const VideoList: NextPage = () => { const router = useRouter(); @@ -49,13 +50,11 @@ const VideoList: NextPage = () => { Personal Library - - Share - + - + {video?.video?.video_url && (