-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
129 additions
and
69 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import PatientVideoLayout from '@/components/page-components/video/PatientVideoLayout'; | ||
import { ReactNode } from 'react'; | ||
|
||
const layout = ({ children }: { children: ReactNode; }) => { | ||
return ( | ||
<PatientVideoLayout> | ||
{children} | ||
</PatientVideoLayout> | ||
) | ||
} | ||
|
||
export default layout |
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
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
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
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
35 changes: 35 additions & 0 deletions
35
client/components/page-components/video/PatientVideoLayout.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use client' | ||
import { useAuth } from '@/lib/hooks/useAuth'; | ||
import { ReactNode, useEffect, useState } from 'react' | ||
import { notFound } from 'next/navigation'; | ||
import VideoCallSkeleton from '@/components/skeletons/VideoSection'; | ||
|
||
const PatientVideoLayout = ({ children }: { children: ReactNode }) => { | ||
const [isLoading, setLoading] = useState(true); | ||
const { patientToken } = useAuth(); | ||
const isPatient = !!patientToken; | ||
|
||
useEffect(() => { | ||
if (isPatient) { | ||
const timer = setTimeout(() => { | ||
setLoading(false); | ||
}, 0); | ||
return () => clearTimeout(timer); | ||
} else { | ||
setLoading(false); | ||
} | ||
}, [isPatient]); | ||
|
||
if(isLoading){ | ||
return <VideoCallSkeleton /> | ||
} | ||
|
||
if (!isPatient) { | ||
notFound() | ||
} | ||
return ( | ||
<div>{children}</div> | ||
) | ||
} | ||
|
||
export default PatientVideoLayout |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
import { Card } from "@/components/ui/card" | ||
import { Skeleton } from "@/components/ui/skeleton" | ||
|
||
export default function VideoCallSkeleton() { | ||
return ( | ||
<div className="h-screen flex flex-col bg-gradient-to-b from-gray-900 to-gray-800 text-white"> | ||
<Card className="flex flex-col items-center justify-center flex-grow bg-transparent border-0 shadow-none"> | ||
<Skeleton className="w-24 h-24 rounded-full mb-8 bg-gray-700" /> | ||
<Skeleton className="h-10 w-3/4 max-w-md mb-6 bg-gray-700" /> | ||
<Skeleton className="h-12 w-48 rounded-full bg-gray-700" /> | ||
</Card> | ||
</div> | ||
) | ||
} |
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
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
92c7ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
avm-care – ./
avm-care-sinans-projects-8d312afe.vercel.app
avm-care-git-main-sinans-projects-8d312afe.vercel.app
avm-care.vercel.app