Skip to content

Commit

Permalink
Sync context menu types with contextMenu ext
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Oct 15, 2024
1 parent 2820625 commit cacf971
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonlight-mod/mappings",
"version": "1.0.4",
"version": "1.0.5",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
24 changes: 16 additions & 8 deletions src/mappings/discord/components/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,19 +639,18 @@ export type Text = ComponentType<
// #endregion

// #region Menu
// TODO: find others
export type MenuVariant = "flexible";

export type MenuSeparator = ComponentType<PropsWithoutRef<{}>>;
export type MenuGroup = ComponentType<
PropsWithChildren<{
label?: ReactNode;
className?: string;
color?: string;
}>
>;

export type MenuItemProps = {
className?: string;
id: string;
id: any;
navigatable?: boolean;
render?: (props: MenuItemProps) => ReactNode;
label: ReactNode;
Expand Down Expand Up @@ -691,7 +690,7 @@ export type MenuItem = ComponentType<PropsWithChildren<MenuItemProps>>;
export type MenuCheckboxItem = ComponentType<
PropsWithoutRef<{
className?: string;
id: string;
id: any;
color?: string;
label: string;
checked: boolean;
Expand All @@ -706,9 +705,9 @@ export type MenuCheckboxItem = ComponentType<

export type MenuRadioItem = ComponentType<
PropsWithoutRef<{
id: string;
color?: string;
id: any;
label: string;
color?: string;
checked: boolean;
subtext?: string;
disabled?: string;
Expand Down Expand Up @@ -737,12 +736,20 @@ export type Menu = ComponentType<
PropsWithChildren<{
className?: string;
navId: string;
variant?: MenuVariant;
variant?: string;
hideScroller?: boolean;
onClose?: () => void;
onSelect?: () => void;
}>
>;

export type MenuElement =
| MenuSeparator
| MenuGroup
| MenuItem
| MenuCheckboxItem
| MenuRadioItem
| MenuControlItem;
// #endregion

export type TitleTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
Expand Down Expand Up @@ -947,6 +954,7 @@ type CommonComponents = {
MenuRadioItem: MenuRadioItem;
MenuCheckboxItem: MenuCheckboxItem;
MenuControlItem: MenuControlItem;
MenuSeparator: MenuSeparator;
SettingsNotice: React.ComponentType<{
submitting: boolean;
onReset: () => void;
Expand Down

0 comments on commit cacf971

Please sign in to comment.