only show share settings button to video author
This commit is contained in:
parent
665369c43c
commit
81a9d739f9
1 changed files with 5 additions and 1 deletions
|
|
@ -8,9 +8,11 @@ import Link from "next/link";
|
|||
import Image from "next/image";
|
||||
import { getTime } from "~/utils/getTime";
|
||||
import { ShareModal } from "~/components/ShareModal";
|
||||
import { useSession } from "next-auth/react";
|
||||
|
||||
const VideoList: NextPage = () => {
|
||||
const router = useRouter();
|
||||
const { data: session } = useSession();
|
||||
const { videoId } = router.query as { videoId: string };
|
||||
|
||||
const { data: video, isLoading } = api.video.get.useQuery(
|
||||
|
|
@ -50,7 +52,9 @@ const VideoList: NextPage = () => {
|
|||
Personal Library
|
||||
</span>
|
||||
</Link>
|
||||
{video ? <ShareModal video={video} /> : null}
|
||||
{video && video.userId === session?.user.id ? (
|
||||
<ShareModal video={video} />
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex h-full w-full grow flex-col items-center justify-start overflow-auto bg-[#fbfbfb]">
|
||||
|
|
|
|||
Loading…
Reference in a new issue