Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add components found while working on tabmaster #90

Merged
merged 5 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = findModuleChild((mod) => {
Tormak9970 marked this conversation as resolved.
Show resolved Hide resolved
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) => {
TrainDoctor marked this conversation as resolved.
Show resolved Hide resolved
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 } from "../webpack";

const ScrollingModule = findModuleChild((mod) => {
Tormak9970 marked this conversation as resolved.
Show resolved Hide resolved
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