MCPcopy Create free account
hub / github.com/NativeScript/template-macos-solid / AppMenus

Function AppMenus

src/app-menus.tsx:1–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1export default function AppMenus() {
2 function openDocs() {
3 NSWorkspace.sharedWorkspace.openURL(
4 NSURL.URLWithString("https://solidjs.com")
5 );
6 }
7
8 function openGithub() {
9 NSWorkspace.sharedWorkspace.openURL(
10 NSURL.URLWithString("https://github.com/solidjs/solid")
11 );
12 }
13
14 function openDiscord() {
15 NSWorkspace.sharedWorkspace.openURL(
16 NSURL.URLWithString("https://discord.com/invite/solidjs")
17 );
18 }
19
20 return (
21 <>
22 <menu attachToMainMenu>
23 <menu-item
24 title="Quit"
25 shortcutKey="q"
26 onClick={() => {
27 NSApp.terminate(NSApp);
28 }}
29 />
30 </menu>
31 <menu title="Help" attachToMainMenu>
32 <menu-item title="Open Docs" shortcutKey="i" onClick={openDocs} />
33 <menu-item title="Open Github" shortcutKey="g" onClick={openGithub} />
34 <menu-item title="Discord" shortcutKey="d" onClick={openDiscord} />
35 </menu>
36 </>
37 );
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected