From 24579274eaf360a675afb3c91deb2047c6a3b977 Mon Sep 17 00:00:00 2001 From: MarconLP <13001502+MarconLP@users.noreply.github.com> Date: Sun, 23 Apr 2023 21:23:13 +0200 Subject: [PATCH] add record video CTA to shared video page --- src/pages/share/[videoId].tsx | 50 ++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/src/pages/share/[videoId].tsx b/src/pages/share/[videoId].tsx index 31535ad..d045089 100644 --- a/src/pages/share/[videoId].tsx +++ b/src/pages/share/[videoId].tsx @@ -12,12 +12,16 @@ import { useSession } from "next-auth/react"; import VideoMoreMenu from "~/components/VideoMoreMenu"; import ProfileMenu from "~/components/ProfileMenu"; import { usePostHog } from "posthog-js/react"; +import { useAtom } from "jotai"; +import recordVideoModalOpen from "~/atoms/recordVideoModalOpen"; +import VideoRecordModal from "~/components/VideoRecordModal"; const VideoList: NextPage = () => { const router = useRouter(); const { status, data: session } = useSession(); const { videoId } = router.query as { videoId: string }; const posthog = usePostHog(); + const [, setRecordOpen] = useAtom(recordVideoModalOpen); const { data: video, isLoading } = api.video.get.useQuery( { videoId }, @@ -38,6 +42,15 @@ const VideoList: NextPage = () => { } ); + const openRecordModal = () => { + setRecordOpen(true); + + posthog?.capture("open record video modal", { + stripeSubscriptionStatus: session?.user.stripeSubscriptionStatus, + cta: "shared video", + }); + }; + if (!isLoading && !video) { return (
@@ -73,20 +86,29 @@ const VideoList: NextPage = () => { Snapify
{video && video.userId === session?.user.id ? ( - + <> + + + ) : null} - - - Personal Library - - - {video && video.userId === session?.user.id ? ( - - ) : null} - {status === "authenticated" && ( -
- -
+ {status === "authenticated" ? ( + <> + + + Personal Library + + +
+ +
+ + ) : ( + )}
@@ -169,6 +191,8 @@ const VideoList: NextPage = () => { + + ); };