UPDATE: Move user status fetch to App.tsx;
REFACTOR: Rename `Vods` & `Following` to `VodsPage` & `FollowingPage` and improve structure; UPDATE: Change default profile picture; REFACTOR: Remove VOD testing data; UPDATE: Change `VideoPlayer` atrributes;
This commit is contained in:
@@ -11,7 +11,7 @@ interface DashboardPageProps {
|
||||
}
|
||||
|
||||
const DashboardPage: React.FC<DashboardPageProps> = ({ tab = "dashboard" }) => {
|
||||
const { username, isLive, userId, setIsLive } = useAuth();
|
||||
const { username, isLive, userId } = useAuth();
|
||||
const { vods } = useVods(`/api/vods/${username}`);
|
||||
const [selectedTab, setSelectedTab] = useState<"dashboard" | "stream" | "vod">(tab);
|
||||
|
||||
@@ -21,24 +21,6 @@ const DashboardPage: React.FC<DashboardPageProps> = ({ tab = "dashboard" }) => {
|
||||
dashboard: "white",
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (username) {
|
||||
checkUserStatus();
|
||||
}
|
||||
}, [username]);
|
||||
|
||||
const checkUserStatus = async () => {
|
||||
if (!username) return;
|
||||
|
||||
try {
|
||||
const response = await fetch(`/api/user/${username}/status`);
|
||||
const data = await response.json();
|
||||
setIsLive(data.is_live);
|
||||
} catch (error) {
|
||||
console.error("Error checking user status:", error);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<DynamicPageContent className="flex flex-col min-h-screen bg-gradient-radial from-purple-600 via-blue-900 to-black">
|
||||
<div id="dashboard" className="flex flex-col justify-evenly items-center h-full text-white">
|
||||
|
||||
Reference in New Issue
Block a user