2022-06-06 23:39:03 +02:00
|
|
|
import { ReactNode, VFC } from 'react';
|
|
|
|
|
|
|
|
|
|
import { Module, findModuleChild } from '../webpack';
|
|
|
|
|
|
|
|
|
|
export interface SidebarNavigationPages {
|
|
|
|
|
title: string;
|
|
|
|
|
content: ReactNode;
|
2022-10-01 19:33:02 -06:00
|
|
|
icon?: ReactNode;
|
|
|
|
|
visible?: boolean;
|
|
|
|
|
hideTitle?: boolean;
|
|
|
|
|
identifier?: string;
|
|
|
|
|
route?: string;
|
|
|
|
|
link?: string;
|
|
|
|
|
padding?: "none" | "compact";
|
2022-06-06 23:39:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface SidebarNavigationProps {
|
|
|
|
|
title?: string;
|
|
|
|
|
pages: SidebarNavigationPages[];
|
|
|
|
|
showTitle?: boolean;
|
|
|
|
|
disableRouteReporting?: boolean;
|
2022-10-01 19:33:02 -06:00
|
|
|
page?: string;
|
|
|
|
|
onPageRequested?: (page: string) => void;
|
2022-06-06 23:39:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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>;
|