* Fix drawer not being scrollable

* Fix margin

* Use 2 columns for large mobile devices

* Move padding

* Add review summary to mobile calendar

* Make header spacing consistent between pages

* remove red
This commit is contained in:
Nicolas Mowen 2024-03-28 11:53:36 -06:00 committed by GitHub
parent 36d5e5b45f
commit 0223d6df60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 34 additions and 25 deletions

View File

@ -187,6 +187,7 @@ export default function ReviewFilterGroup({
<MobileReviewSettingsDrawer <MobileReviewSettingsDrawer
features={mobileSettingsFeatures} features={mobileSettingsFeatures}
filter={filter} filter={filter}
reviewSummary={reviewSummary}
onUpdateFilter={onUpdateFilter} onUpdateFilter={onUpdateFilter}
// not applicable as exports are not used // not applicable as exports are not used
camera="" camera=""
@ -377,7 +378,7 @@ function ShowReviewFilter({
</div> </div>
<Button <Button
className="block md:hidden ml-1" className="block md:hidden"
size="sm" size="sm"
variant="secondary" variant="secondary"
onClick={() => setShowReviewed(showReviewed == 0 ? 1 : 0)} onClick={() => setShowReviewed(showReviewed == 0 ? 1 : 0)}

View File

@ -27,7 +27,8 @@ export default function MobileCameraDrawer({
<FaVideo className="text-muted-foreground" /> <FaVideo className="text-muted-foreground" />
</Button> </Button>
</DrawerTrigger> </DrawerTrigger>
<DrawerContent className="max-h-[75dvh] overflow-y-auto flex flex-col items-center gap-2 px-4 pb-4 mx-1 rounded-t-2xl"> <DrawerContent className="max-h-[75dvh] px-4 mx-1 rounded-t-2xl overflow-hidden">
<div className="w-full h-auto py-4 overflow-y-auto overflow-x-hidden flex flex-col items-center gap-2">
{allCameras.map((cam) => ( {allCameras.map((cam) => (
<div <div
key={cam} key={cam}
@ -40,6 +41,7 @@ export default function MobileCameraDrawer({
{cam.replaceAll("_", " ")} {cam.replaceAll("_", " ")}
</div> </div>
))} ))}
</div>
</DrawerContent> </DrawerContent>
</Drawer> </Drawer>
); );

View File

@ -7,7 +7,7 @@ import { ExportContent } from "./ExportDialog";
import { ExportMode } from "@/types/filter"; import { ExportMode } from "@/types/filter";
import ReviewActivityCalendar from "./ReviewActivityCalendar"; import ReviewActivityCalendar from "./ReviewActivityCalendar";
import { SelectSeparator } from "../ui/select"; import { SelectSeparator } from "../ui/select";
import { ReviewFilter } from "@/types/review"; import { ReviewFilter, ReviewSummary } from "@/types/review";
import { getEndOfDayTimestamp } from "@/utils/dateUtil"; import { getEndOfDayTimestamp } from "@/utils/dateUtil";
import { GeneralFilterContent } from "../filter/ReviewFilterGroup"; import { GeneralFilterContent } from "../filter/ReviewFilterGroup";
import useSWR from "swr"; import useSWR from "swr";
@ -36,6 +36,7 @@ type MobileReviewSettingsDrawerProps = {
currentTime: number; currentTime: number;
range?: TimeRange; range?: TimeRange;
mode: ExportMode; mode: ExportMode;
reviewSummary?: ReviewSummary;
onUpdateFilter: (filter: ReviewFilter) => void; onUpdateFilter: (filter: ReviewFilter) => void;
setRange: (range: TimeRange | undefined) => void; setRange: (range: TimeRange | undefined) => void;
setMode: (mode: ExportMode) => void; setMode: (mode: ExportMode) => void;
@ -48,6 +49,7 @@ export default function MobileReviewSettingsDrawer({
currentTime, currentTime,
range, range,
mode, mode,
reviewSummary,
onUpdateFilter, onUpdateFilter,
setRange, setRange,
setMode, setMode,
@ -201,6 +203,7 @@ export default function MobileReviewSettingsDrawer({
</div> </div>
</div> </div>
<ReviewActivityCalendar <ReviewActivityCalendar
reviewSummary={reviewSummary}
selectedDay={ selectedDay={
filter?.after == undefined filter?.after == undefined
? undefined ? undefined

View File

@ -206,9 +206,9 @@ export default function EventView({
return ( return (
<div className="flex flex-col size-full"> <div className="flex flex-col size-full">
<div className="h-10 relative flex justify-between items-center mx-2"> <div className="h-11 px-2 relative flex justify-between items-center">
{isMobile && ( {isMobile && (
<Logo className="absolute inset-y-0 inset-x-1/2 -translate-x-1/2 h-8" /> <Logo className="absolute inset-x-1/2 -translate-x-1/2 h-8" />
)} )}
<ToggleGroup <ToggleGroup
className="*:px-3 *:py-4 *:rounded-2xl" className="*:px-3 *:py-4 *:rounded-2xl"
@ -492,7 +492,7 @@ function DetectionReview({
<> <>
<div <div
ref={contentRef} ref={contentRef}
className="flex flex-1 flex-wrap content-start gap-2 md:gap-4 overflow-y-auto no-scrollbar" className="mt-2 flex flex-1 flex-wrap content-start gap-2 md:gap-4 overflow-y-auto no-scrollbar"
> >
{filter?.before == undefined && ( {filter?.before == undefined && (
<NewReviewData <NewReviewData

View File

@ -225,13 +225,14 @@ export function RecordingView({
<div ref={contentRef} className="size-full flex flex-col"> <div ref={contentRef} className="size-full flex flex-col">
<Toaster /> <Toaster />
<div <div
className={`w-full h-10 px-2 relative flex items-center justify-between`} className={`w-full h-11 px-2 relative flex items-center justify-between`}
> >
{isMobile && ( {isMobile && (
<Logo className="absolute top-1 inset-x-1/2 -translate-x-1/2 h-8" /> <Logo className="absolute inset-x-1/2 -translate-x-1/2 h-8" />
)} )}
<Button <Button
className="flex items-center gap-2 rounded-lg" className="flex items-center gap-2 rounded-lg"
size="sm"
onClick={() => navigate(-1)} onClick={() => navigate(-1)}
> >
<IoMdArrowRoundBack className="size-5" size="small" /> <IoMdArrowRoundBack className="size-5" size="small" />
@ -482,7 +483,9 @@ function Timeline({
onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)} onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}
/> />
) : ( ) : (
<div className="h-full flex flex-col gap-4 overflow-auto p-4 bg-secondary"> <div
className={`h-full grid grid-cols-1 gap-4 overflow-auto p-4 bg-secondary ${isDesktop ? "" : "sm:grid-cols-2"}`}
>
{mainCameraReviewItems.map((review) => { {mainCameraReviewItems.map((review) => {
if (review.severity == "significant_motion") { if (review.severity == "significant_motion") {
return; return;

View File

@ -129,10 +129,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 px-2"> <div className="size-full overflow-y-auto">
{isMobile && ( {isMobile && (
<div className="relative h-9 flex items-center justify-between"> <div className="h-11 px-2 relative flex items-center justify-between">
<Logo className="absolute inset-y-0 inset-x-1/2 -translate-x-1/2 h-8" /> <Logo className="absolute inset-x-1/2 -translate-x-1/2 h-8" />
<CameraGroupSelector /> <CameraGroupSelector />
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<Button <Button
@ -175,7 +175,7 @@ export default function LiveDashboardView({
)} )}
<div <div
className={`my-4 grid ${layout == "grid" ? "grid-cols-2 xl:grid-cols-3 3xl:grid-cols-4" : ""} gap-2 md:gap-4 *:rounded-2xl *:bg-black`} className={`mt-2 px-2 grid ${layout == "grid" ? "grid-cols-2 xl:grid-cols-3 3xl:grid-cols-4" : ""} gap-2 md:gap-4 *:rounded-2xl *:bg-black`}
> >
{includeBirdseye && birdseyeConfig?.enabled && ( {includeBirdseye && birdseyeConfig?.enabled && (
<BirdseyeLivePlayer <BirdseyeLivePlayer