-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4cf2e2
commit f10b372
Showing
12 changed files
with
59 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
"installdir", | ||
"Jsonifiable", | ||
"konami", | ||
"leaderboard", | ||
"lezer", | ||
"LOCALAPPDATA", | ||
"logname", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,29 @@ | ||
import components from "@common/components"; | ||
import type React from "react"; | ||
import { filters, waitForModule } from "../webpack"; | ||
import type { Variant } from "./Text"; | ||
|
||
const Types = { | ||
const HelpMessageTypes = { | ||
WARNING: 0, | ||
INFO: 1, | ||
ERROR: 2, | ||
POSITIVE: 3, | ||
} as const; | ||
|
||
interface NoticeProps { | ||
interface HelpMessageProps { | ||
children: React.ReactNode; | ||
messageType: (typeof Types)[keyof typeof Types]; | ||
messageType: (typeof HelpMessageTypes)[keyof typeof HelpMessageTypes]; | ||
textColor?: string; | ||
textVariant?: Variant; | ||
className?: string; | ||
} | ||
|
||
export type NoticeType = React.FC<NoticeProps> & { | ||
Types: typeof Types; // for backwards compat | ||
HelpMessageTypes: typeof Types; | ||
default: React.FC<NoticeProps>; | ||
export type NoticeType = React.FC<HelpMessageProps> & { | ||
Types: typeof HelpMessageTypes; // for backwards compat | ||
HelpMessageTypes: typeof HelpMessageTypes; | ||
}; | ||
|
||
const NoticeComp = await waitForModule<NoticeType>(filters.bySource("WARNING=0]")); | ||
//const Notice = NoticeComp.default as NoticeType; | ||
// Notice component is a top-level exported function | ||
const Notice = Object.values(NoticeComp).find((v) => typeof v === "function") as NoticeType; | ||
// Help Message Types are a top-level exported object | ||
Notice.HelpMessageTypes = Object.values(NoticeComp).find((v) => "INFO" in v)! as typeof Types; | ||
Notice.Types = Notice.HelpMessageTypes; | ||
//Notice.Types = NoticeComp.HelpMessageTypes; | ||
//Notice.HelpMessageTypes = NoticeComp.HelpMessageTypes; | ||
const { HelpMessage } = components; | ||
HelpMessage.HelpMessageTypes = components.HelpMessageTypes; | ||
HelpMessage.Types = HelpMessage.HelpMessageTypes; | ||
|
||
export default Notice; | ||
export default HelpMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters