fix layout sizings

Co-authored-by: Jip Frijlink <JipFr@users.noreply.github.com>
This commit is contained in:
mrjvs 2023-02-24 22:12:31 +01:00
parent 24aeb68f55
commit f715f70f9e
8 changed files with 24 additions and 17 deletions

View File

@ -11,8 +11,8 @@ export function Banner(props: { children: React.ReactNode; type: "error" }) {
}; };
return ( return (
<div ref={ref}>
<div <div
ref={ref}
className={[ className={[
styles[props.type], styles[props.type],
"flex items-center justify-center p-1", "flex items-center justify-center p-1",
@ -23,5 +23,6 @@ export function Banner(props: { children: React.ReactNode; type: "error" }) {
<div>{props.children}</div> <div>{props.children}</div>
</div> </div>
</div> </div>
</div>
); );
} }

View File

@ -18,6 +18,7 @@ export function Layout(props: { children: ReactNode }) {
style={{ style={{
paddingTop: `${bannerSize}px`, paddingTop: `${bannerSize}px`,
}} }}
className="flex min-h-screen flex-col"
> >
{props.children} {props.children}
</div> </div>

View File

@ -120,6 +120,7 @@ export function VideoPlayer(props: Props) {
<HeaderAction <HeaderAction
showControls={isMobile} showControls={isMobile}
onClick={props.onGoBack} onClick={props.onGoBack}
isFullScreen
/> />
</Transition> </Transition>
<Transition <Transition

View File

@ -5,6 +5,7 @@ import { useMeta } from "@/video/state/logic/meta";
interface Props { interface Props {
onClick?: () => void; onClick?: () => void;
showControls?: boolean; showControls?: boolean;
isFullScreen: boolean;
} }
export function HeaderAction(props: Props) { export function HeaderAction(props: Props) {

View File

@ -16,6 +16,7 @@ interface VideoPlayerHeaderProps {
media?: MWMediaMeta; media?: MWMediaMeta;
onClick?: () => void; onClick?: () => void;
showControls?: boolean; showControls?: boolean;
isFullScreen?: boolean;
} }
export function VideoPlayerHeader(props: VideoPlayerHeaderProps) { export function VideoPlayerHeader(props: VideoPlayerHeaderProps) {
@ -31,7 +32,9 @@ export function VideoPlayerHeader(props: VideoPlayerHeaderProps) {
return ( return (
<div <div
className="flex items-center" className="flex items-center"
style={{ paddingTop: `${bannerHeight}px` }} style={{
paddingTop: props.isFullScreen ? `${bannerHeight}px` : undefined,
}}
> >
<div className="flex min-w-0 flex-1 items-center"> <div className="flex min-w-0 flex-1 items-center">
<p className="flex items-center truncate"> <p className="flex items-center truncate">

View File

@ -9,7 +9,7 @@ export function MediaFetchErrorView() {
const goBack = useGoBack(); const goBack = useGoBack();
return ( return (
<div className="h-screen flex-1"> <div className="flex-1">
<Helmet> <Helmet>
<title>{t("media.errors.failedMeta")}</title> <title>{t("media.errors.failedMeta")}</title>
</Helmet> </Helmet>

View File

@ -28,7 +28,7 @@ function MediaViewLoading(props: { onGoBack(): void }) {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<div className="relative flex h-screen items-center justify-center"> <div className="relative flex flex-1 items-center justify-center">
<Helmet> <Helmet>
<title>{t("videoPlayer.loading")}</title> <title>{t("videoPlayer.loading")}</title>
</Helmet> </Helmet>
@ -62,7 +62,7 @@ function MediaViewScraping(props: MediaViewScrapingProps) {
}, [stream, props]); }, [stream, props]);
return ( return (
<div className="relative flex h-screen items-center justify-center"> <div className="relative flex flex-1 items-center justify-center">
<Helmet> <Helmet>
<title>{props.meta.meta.title}</title> <title>{props.meta.meta.title}</title>
</Helmet> </Helmet>

View File

@ -17,18 +17,18 @@ export function NotFoundWrapper(props: {
const goBack = useGoBack(); const goBack = useGoBack();
return ( return (
<div className="h-screen flex-1"> <div className="relative flex flex-1 flex-col">
<Helmet> <Helmet>
<title>{t("notFound.genericTitle")}</title> <title>{t("notFound.genericTitle")}</title>
</Helmet> </Helmet>
{props.video ? ( {props.video ? (
<div className="fixed inset-x-0 top-0 py-6 px-8"> <div className="absolute inset-x-0 top-0 py-6 px-8">
<VideoPlayerHeader onClick={goBack} /> <VideoPlayerHeader onClick={goBack} />
</div> </div>
) : ( ) : (
<Navigation /> <Navigation />
)} )}
<div className="flex h-full flex-col items-center justify-center p-5 text-center"> <div className="flex h-full flex-1 flex-col items-center justify-center p-5 text-center">
{props.children} {props.children}
</div> </div>
</div> </div>