mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-20 10:00:08 +02:00
34 lines
797 B
TypeScript
34 lines
797 B
TypeScript
import { ReactNode, VFC } from 'react';
|
|
|
|
import { Module, findModuleChild } from '../webpack';
|
|
|
|
export interface SidebarNavigationPage {
|
|
title: string;
|
|
content: ReactNode;
|
|
icon?: ReactNode;
|
|
visible?: boolean;
|
|
hideTitle?: boolean;
|
|
identifier?: string;
|
|
route?: string;
|
|
link?: string;
|
|
padding?: 'none' | 'compact';
|
|
}
|
|
|
|
export interface SidebarNavigationProps {
|
|
title?: string;
|
|
pages: SidebarNavigationPage[];
|
|
showTitle?: boolean;
|
|
disableRouteReporting?: boolean;
|
|
page?: string;
|
|
onPageRequested?: (page: string) => void;
|
|
}
|
|
|
|
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>;
|