hide birdseye nav if not enabled

This commit is contained in:
Bernt Christian Egeland 2021-08-30 18:21:20 +02:00 committed by Blake Blackshear
parent 65855e23d9
commit b8df419bad

View File

@ -10,6 +10,7 @@ import NavigationDrawer, { Destination, Separator } from './components/Navigatio
export default function Sidebar() { export default function Sidebar() {
const { data: config } = useConfig(); const { data: config } = useConfig();
const cameras = useMemo(() => Object.entries(config.cameras), [config]); const cameras = useMemo(() => Object.entries(config.cameras), [config]);
const { birdseye } = config;
return ( return (
<NavigationDrawer header={<Header />}> <NavigationDrawer header={<Header />}>
@ -49,7 +50,7 @@ export default function Sidebar() {
) : null ) : null
} }
</Match> </Match>
<Destination href="/birdseye" text="Birdseye" /> {birdseye?.enabled ? <Destination href="/birdseye" text="Birdseye" /> : null}
<Destination href="/events" text="Events" /> <Destination href="/events" text="Events" />
<Destination href="/debug" text="Debug" /> <Destination href="/debug" text="Debug" />
<Separator /> <Separator />