mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
spacing on mobile landscape (#11397)
This commit is contained in:
parent
525de1a467
commit
dd0dee620a
@ -8,6 +8,7 @@ import Statusbar from "./components/Statusbar";
|
|||||||
import Bottombar from "./components/navigation/Bottombar";
|
import Bottombar from "./components/navigation/Bottombar";
|
||||||
import { Suspense, lazy } from "react";
|
import { Suspense, lazy } from "react";
|
||||||
import { Redirect } from "./components/navigation/Redirect";
|
import { Redirect } from "./components/navigation/Redirect";
|
||||||
|
import { cn } from "./lib/utils";
|
||||||
|
|
||||||
const Live = lazy(() => import("@/pages/Live"));
|
const Live = lazy(() => import("@/pages/Live"));
|
||||||
const Events = lazy(() => import("@/pages/Events"));
|
const Events = lazy(() => import("@/pages/Events"));
|
||||||
@ -31,7 +32,12 @@ function App() {
|
|||||||
{isMobile && <Bottombar />}
|
{isMobile && <Bottombar />}
|
||||||
<div
|
<div
|
||||||
id="pageRoot"
|
id="pageRoot"
|
||||||
className={`absolute right-0 top-0 overflow-hidden ${isMobile ? "bottom-16 left-0" : "bottom-8 left-[52px]"}`}
|
className={cn(
|
||||||
|
"absolute right-0 top-0 overflow-hidden",
|
||||||
|
isMobile
|
||||||
|
? "bottom-12 left-0 md:bottom-16 landscape:bottom-14 landscape:md:bottom-16"
|
||||||
|
: "bottom-8 left-[52px]",
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<Routes>
|
<Routes>
|
||||||
|
@ -5,7 +5,7 @@ type TWrapperProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Wrapper = ({ children }: TWrapperProps) => {
|
const Wrapper = ({ children }: TWrapperProps) => {
|
||||||
return <main className="h-dvh w-screen overflow-hidden">{children}</main>;
|
return <main className="h-dvh w-full overflow-hidden">{children}</main>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Wrapper;
|
export default Wrapper;
|
||||||
|
@ -15,12 +15,18 @@ import {
|
|||||||
} from "@/context/statusbar-provider";
|
} from "@/context/statusbar-provider";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
import { isMobile } from "react-device-detect";
|
||||||
|
|
||||||
function Bottombar() {
|
function Bottombar() {
|
||||||
const navItems = useNavigation("secondary");
|
const navItems = useNavigation("secondary");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="absolute inset-x-4 bottom-0 flex h-16 flex-row items-center justify-between">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"absolute inset-x-4 bottom-0 flex flex-row items-center justify-between",
|
||||||
|
isMobile ? "h-12 landscape:md:h-16" : "h-16",
|
||||||
|
)}
|
||||||
|
>
|
||||||
{navItems.map((item) => (
|
{navItems.map((item) => (
|
||||||
<NavItem key={item.id} className="p-2" item={item} Icon={item.icon} />
|
<NavItem key={item.id} className="p-2" item={item} Icon={item.icon} />
|
||||||
))}
|
))}
|
||||||
@ -72,8 +78,10 @@ function StatusAlertNav({ className }: StatusAlertNavProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Drawer>
|
<Drawer>
|
||||||
<DrawerTrigger>
|
<DrawerTrigger asChild>
|
||||||
<IoIosWarning className="size-5 text-danger" />
|
<div className="p-2">
|
||||||
|
<IoIosWarning className="size-5 text-danger md:m-[6px]" />
|
||||||
|
</div>
|
||||||
</DrawerTrigger>
|
</DrawerTrigger>
|
||||||
<DrawerContent
|
<DrawerContent
|
||||||
className={cn(
|
className={cn(
|
||||||
@ -95,7 +103,11 @@ function StatusAlertNav({ className }: StatusAlertNavProps) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
return <Link to={link}>{message}</Link>;
|
return (
|
||||||
|
<Link key={id} to={link}>
|
||||||
|
{message}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ function Exports() {
|
|||||||
const [selected, setSelected] = useState<Export>();
|
const [selected, setSelected] = useState<Export>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex size-full flex-col gap-2 overflow-hidden p-2">
|
<div className="flex size-full flex-col gap-2 overflow-hidden px-1 pt-2 md:p-2">
|
||||||
<AlertDialog
|
<AlertDialog
|
||||||
open={deleteClip != undefined}
|
open={deleteClip != undefined}
|
||||||
onOpenChange={() => setDeleteClip(undefined)}
|
onOpenChange={() => setDeleteClip(undefined)}
|
||||||
|
@ -252,7 +252,7 @@ export default function EventView({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex size-full flex-col py-2">
|
<div className="flex size-full flex-col pt-2 md:py-2">
|
||||||
<Toaster closeButton={true} />
|
<Toaster closeButton={true} />
|
||||||
<div className="relative mb-2 flex h-11 items-center justify-between pl-3 pr-2">
|
<div className="relative mb-2 flex h-11 items-center justify-between pl-3 pr-2">
|
||||||
{isMobile && (
|
{isMobile && (
|
||||||
|
@ -155,7 +155,10 @@ export default function LiveDashboardView({
|
|||||||
const birdseyeConfig = useMemo(() => config?.birdseye, [config]);
|
const birdseyeConfig = useMemo(() => config?.birdseye, [config]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="size-full overflow-y-auto p-2" ref={containerRef}>
|
<div
|
||||||
|
className="size-full overflow-y-auto px-1 pt-2 md:p-2"
|
||||||
|
ref={containerRef}
|
||||||
|
>
|
||||||
{isMobile && (
|
{isMobile && (
|
||||||
<div className="relative flex h-11 items-center justify-between">
|
<div className="relative flex h-11 items-center justify-between">
|
||||||
<Logo className="absolute inset-x-1/2 h-8 -translate-x-1/2" />
|
<Logo className="absolute inset-x-1/2 h-8 -translate-x-1/2" />
|
||||||
|
Loading…
Reference in New Issue
Block a user