Skip to content

Commit

Permalink
fix: Switch component (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
asportnoy authored Apr 8, 2023
2 parents 136c789 + 911fd5a commit 28610e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/renderer/modules/common/guilds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export type Guilds = (Store & Record<string, unknown>) & {
getLastSelectedGuildId: () => string | undefined;
getLastSelectedTimestamp: (guildId: string) => number;
getState: () => State;
getTabsV2SelectedGuildId: () => string | undefined;
isLoaded: () => boolean;
};

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/modules/components/CheckboxItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface CheckboxProps {
onChange?: (e: React.ChangeEvent<HTMLInputElement>, state: boolean) => void;
}

export type CheckboxType = React.ComponentType<CheckboxProps> & {
export type CheckboxType = React.FC<React.PropsWithChildren<CheckboxProps>> & {
defaultProps: CheckboxProps;
Types: Record<"DEFAULT" | "INVERTED" | "GHOST" | "ROW", string>;
Aligns: Record<"TOP" | "CENTER", string>;
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/modules/components/SwitchItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ export type SwitchItemType = ReactComponent<{
}>;

const switchModStr = "xMinYMid meet";
const switchRgx = /{className:\w+\(\)\(\w+,\w+\.className\)}/;
const switchItemStr = ").dividerDefault";

export const Switch = (await waitForModule(filters.bySource(switchModStr)).then((mod) => {
if (typeof mod === "function") return mod;
return getFunctionBySource(mod as ObjectExports, switchRgx);
return getFunctionBySource(mod as ObjectExports, switchModStr);
})) as SwitchType;

export const SwitchItem = (await waitForModule(filters.bySource(switchItemStr)).then((mod) => {
Expand Down

0 comments on commit 28610e4

Please sign in to comment.