Refactor <Dropdown>
into TypeScript (#34357)
Co-authored-by: Echo <ChaosExAnima@users.noreply.github.com>
This commit is contained in:
parent
b7c3235349
commit
22d33244ee
21 changed files with 846 additions and 654 deletions
|
@ -3,16 +3,18 @@ interface BaseMenuItem {
|
|||
dangerous?: boolean;
|
||||
}
|
||||
|
||||
interface ActionMenuItem extends BaseMenuItem {
|
||||
export interface ActionMenuItem extends BaseMenuItem {
|
||||
action: () => void;
|
||||
}
|
||||
|
||||
interface LinkMenuItem extends BaseMenuItem {
|
||||
export interface LinkMenuItem extends BaseMenuItem {
|
||||
to: string;
|
||||
}
|
||||
|
||||
interface ExternalLinkMenuItem extends BaseMenuItem {
|
||||
export interface ExternalLinkMenuItem extends BaseMenuItem {
|
||||
href: string;
|
||||
target?: string;
|
||||
method?: 'post' | 'put' | 'delete';
|
||||
}
|
||||
|
||||
export type MenuItem =
|
||||
|
@ -20,5 +22,3 @@ export type MenuItem =
|
|||
| LinkMenuItem
|
||||
| ExternalLinkMenuItem
|
||||
| null;
|
||||
|
||||
export type DropdownMenu = MenuItem[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue