Skip to content

Commit

Permalink
feat: add components found while working on tabmaster
Browse files Browse the repository at this point in the history
  • Loading branch information
TrainDoctor authored Aug 9, 2023
2 parents 1ff9351 + 8a352d2 commit 4f8f65d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/deck-components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,16 @@ export const ModalRoot = (Object.values(
}
}
})) as FC<ModalRootProps>;

interface SimpleModalProps{
active?: boolean,
children: ReactNode
}

const ModalModule = findModule((mod) => {
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
if (mod.SimpleModal && mod.ModalPosition) return mod;
})

export const SimpleModal = ModalModule.SimpleModal as FC<SimpleModalProps>
export const ModalPosition = ModalModule.ModalPosition as FC<SimpleModalProps>
5 changes: 5 additions & 0 deletions src/deck-components/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import { FC, ReactNode } from 'react';

import { findModuleChild } from '../webpack';

export const Panel: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
return mod.Panel;
})

export interface PanelSectionProps {
title?: string;
spinner?: boolean;
Expand Down
14 changes: 14 additions & 0 deletions src/deck-components/Scroll.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { FC, ReactNode } from "react";
import { findModuleChild, findModule } from "../webpack";

const ScrollingModule = findModule((mod) => {
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
if (mod.ScrollPanel) return mod;
});

export const ScrollPanel: FC<{ children?: ReactNode; }> = ScrollingModule.ScrollPanel;

export const ScrollPanelGroup: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
return mod.ScrollPanelGroup;
})
1 change: 1 addition & 0 deletions src/deck-components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from './TextField';
export * from './Toggle';
export * from './ToggleField';
export * from './SteamClient';
export * from './Scroll';

import { AppDetails, LogoPosition, SteamAppOverview, SteamClient } from './SteamClient';

Expand Down

0 comments on commit 4f8f65d

Please sign in to comment.