diff --git a/src/deck-components/SidebarNavigation.tsx b/src/deck-components/SidebarNavigation.tsx new file mode 100644 index 0000000..3305b37 --- /dev/null +++ b/src/deck-components/SidebarNavigation.tsx @@ -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; diff --git a/src/deck-components/index.ts b/src/deck-components/index.ts index bc321f9..c813b53 100755 --- a/src/deck-components/index.ts +++ b/src/deck-components/index.ts @@ -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';