mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
feat: Hide the global header on video player pages and ensure video content always uses full screen height.
This commit is contained in:
@@ -4,13 +4,13 @@ import { useState } from 'react';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import {
|
import {
|
||||||
Video,
|
Video,
|
||||||
FolderOpen,
|
FolderOpen,
|
||||||
Building2,
|
Building2,
|
||||||
Plus,
|
Plus,
|
||||||
Settings,
|
Settings,
|
||||||
LogOut,
|
LogOut,
|
||||||
User,
|
User,
|
||||||
Menu,
|
Menu,
|
||||||
Keyboard
|
Keyboard
|
||||||
@@ -56,6 +56,10 @@ export function Header({ user }: HeaderProps) {
|
|||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const [shortcutsOpen, setShortcutsOpen] = useState(false);
|
const [shortcutsOpen, setShortcutsOpen] = useState(false);
|
||||||
|
|
||||||
|
// Hide header on video player pages — they use full viewport with their own back button
|
||||||
|
const isVideoPage = /\/videos\/[^/]+$/.test(pathname) || pathname.startsWith('/watch/');
|
||||||
|
if (isVideoPage) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
<header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||||
<div className="px-6 lg:px-8 flex h-14 items-center w-full">
|
<div className="px-6 lg:px-8 flex h-14 items-center w-full">
|
||||||
@@ -121,7 +125,7 @@ export function Header({ user }: HeaderProps) {
|
|||||||
New Project
|
New Project
|
||||||
</Link>
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button asChild size="icon" variant="ghost" className="sm:hidden">
|
<Button asChild size="icon" variant="ghost" className="sm:hidden">
|
||||||
<Link href="/projects/new">
|
<Link href="/projects/new">
|
||||||
<Plus className="h-5 w-5" />
|
<Plus className="h-5 w-5" />
|
||||||
|
|||||||
@@ -1370,7 +1370,7 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const containerHeight = mode === 'dashboard' ? 'h-[calc(100vh-3.5rem)]' : 'h-screen';
|
const containerHeight = 'h-screen';
|
||||||
const backHref = mode === 'dashboard'
|
const backHref = mode === 'dashboard'
|
||||||
? `/projects/${propProjectId}`
|
? `/projects/${propProjectId}`
|
||||||
: (video?.projectId ? `/projects/${video.projectId}` : '/');
|
: (video?.projectId ? `/projects/${video.projectId}` : '/');
|
||||||
|
|||||||
Reference in New Issue
Block a user