mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 18:38:47 +02:00
feat(sidebar-navigation): add sidebar navigation component
This commit is contained in:
25
src/deck-components/SidebarNavigation.tsx
Normal file
25
src/deck-components/SidebarNavigation.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ReactNode, VFC } from 'react';
|
||||
|
||||
import { Module, findModuleChild } from '../webpack';
|
||||
|
||||
export interface SidebarNavigationPages {
|
||||
title: string;
|
||||
route: string;
|
||||
content: ReactNode;
|
||||
}
|
||||
|
||||
export interface SidebarNavigationProps {
|
||||
title?: string;
|
||||
pages: SidebarNavigationPages[];
|
||||
showTitle?: boolean;
|
||||
disableRouteReporting?: boolean;
|
||||
}
|
||||
|
||||
export const SidebarNavigation = findModuleChild((mod: Module) => {
|
||||
for (let prop in mod) {
|
||||
if (mod[prop]?.toString()?.includes('"disableRouteReporting"')) {
|
||||
return mod[prop];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}) as VFC<SidebarNavigationProps>;
|
||||
@@ -4,6 +4,7 @@ export * from './Menu';
|
||||
export * from './Modal';
|
||||
export * from './Panel';
|
||||
export * from './Router';
|
||||
export * from './SidebarNavigation';
|
||||
export * from './Slider';
|
||||
export * from './Spinner';
|
||||
export * from './static-classes';
|
||||
|
||||
Reference in New Issue
Block a user