Skip to content

Commit

Permalink
feat(menubar): add GitHub button to menubar help
Browse files Browse the repository at this point in the history
  • Loading branch information
sinankambran authored and Muhammed-Rahif committed Nov 15, 2024
1 parent 4455347 commit 4216ea9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Prettier
on:
pull_request:
pull_request_target:
branches:
- alpha
workflow_dispatch:
Expand Down
20 changes: 20 additions & 0 deletions src/lib/components/Github.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script context="module">
import { writable } from 'svelte/store';
const open = writable(false);
export function openGithubRepo() {
open.set(true);
window.open('https://github.com/Muhammed-Rahif/Notpad', '_blank');
}
</script>

<a
href="https://github.com/Muhammed-Rahif/Notpad"
target="_blank"
on:click|preventDefault={openGithubRepo}
class="text-blue-500 underline"
>
Visit GitHub Repository
</a>

3 changes: 3 additions & 0 deletions src/lib/components/MenuBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import { onMount } from 'svelte';
import { openFontDialog } from './font-dialog/FontDialog.svelte';
import { openAboutDialog } from '@/components/AboutDialog.svelte';
import { openGithubRepo } from '@/components/Github.svelte';
import { toggleGoToDialog } from './GoToDialog.svelte';
import { toggleFindDialog } from './FindDialog.svelte';
Expand Down Expand Up @@ -137,6 +139,7 @@
<Menubar.Menu>
<Menubar.Trigger>Help</Menubar.Trigger>
<Menubar.Content>
<Menubar.Item on:click={openGithubRepo}>GitHub</Menubar.Item>
<Menubar.Item on:click={openAboutDialog}>About Notpad</Menubar.Item>
</Menubar.Content>
</Menubar.Menu>
Expand Down

0 comments on commit 4216ea9

Please sign in to comment.