mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +00:00
[Glitch] Refactor <Header> into TypeScript
Port ebde60ca82 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
24
app/javascript/flavours/glitch/models/dropdown_menu.ts
Normal file
24
app/javascript/flavours/glitch/models/dropdown_menu.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
interface BaseMenuItem {
|
||||
text: string;
|
||||
dangerous?: boolean;
|
||||
}
|
||||
|
||||
interface ActionMenuItem extends BaseMenuItem {
|
||||
action: () => void;
|
||||
}
|
||||
|
||||
interface LinkMenuItem extends BaseMenuItem {
|
||||
to: string;
|
||||
}
|
||||
|
||||
interface ExternalLinkMenuItem extends BaseMenuItem {
|
||||
href: string;
|
||||
}
|
||||
|
||||
export type MenuItem =
|
||||
| ActionMenuItem
|
||||
| LinkMenuItem
|
||||
| ExternalLinkMenuItem
|
||||
| null;
|
||||
|
||||
export type DropdownMenu = MenuItem[];
|
||||
Reference in New Issue
Block a user