-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix warning * Improve event switching speed * Fix icon colors * Only show frigate+ page when frigate+ is enabled * Add link from reecordings to live as well
- Loading branch information
Showing
11 changed files
with
152 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import Logo from "@/components/Logo"; | ||
import { ENV } from "@/env"; | ||
import { FrigateConfig } from "@/types/frigateConfig"; | ||
import { NavData } from "@/types/navigation"; | ||
import { useMemo } from "react"; | ||
import { FaCompactDisc, FaVideo } from "react-icons/fa"; | ||
import { LuConstruction } from "react-icons/lu"; | ||
import { MdVideoLibrary } from "react-icons/md"; | ||
import useSWR from "swr"; | ||
|
||
export default function useNavigation( | ||
variant: "primary" | "secondary" = "primary", | ||
) { | ||
const { data: config } = useSWR<FrigateConfig>("config"); | ||
|
||
return useMemo( | ||
() => | ||
[ | ||
{ | ||
id: 1, | ||
variant, | ||
icon: FaVideo, | ||
title: "Live", | ||
url: "/", | ||
}, | ||
{ | ||
id: 2, | ||
variant, | ||
icon: MdVideoLibrary, | ||
title: "Review", | ||
url: "/review", | ||
}, | ||
{ | ||
id: 3, | ||
variant, | ||
icon: FaCompactDisc, | ||
title: "Export", | ||
url: "/export", | ||
}, | ||
{ | ||
id: 5, | ||
variant, | ||
icon: Logo, | ||
title: "Frigate+", | ||
url: "/plus", | ||
enabled: config?.plus?.enabled == true, | ||
}, | ||
{ | ||
id: 4, | ||
variant, | ||
icon: LuConstruction, | ||
title: "UI Playground", | ||
url: "/playground", | ||
enabled: ENV !== "production", | ||
}, | ||
] as NavData[], | ||
[config?.plus.enabled, variant], | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { IconType } from "react-icons"; | ||
|
||
export type NavData = { | ||
id: number; | ||
variant?: "primary" | "secondary"; | ||
icon: IconType; | ||
title: string; | ||
url: string; | ||
enabled?: boolean; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.