-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dialog): made content scrollable, header & footer sticky
- Loading branch information
1 parent
9a49a7c
commit a71db51
Showing
11 changed files
with
179 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<script context="module"> | ||
import { writable } from 'svelte/store'; | ||
// Store to control the dialog's open state | ||
const open = writable(false); | ||
// Function to open the dialog | ||
export function openShortcutsDialog() { | ||
open.set(true); | ||
} | ||
</script> | ||
|
||
<script lang="ts"> | ||
import * as Table from '@/components/ui/table'; | ||
import * as Dialog from '@/components/ui/dialog'; | ||
import * as Menubar from '@/components/ui/menubar'; | ||
const shortcuts = { | ||
New: 'Ctrl + Alt + N', | ||
Open: 'Ctrl + O', | ||
Save: 'Ctrl + S', | ||
Print: 'Ctrl + P', | ||
Undo: 'Ctrl + Z', | ||
Redo: 'Ctrl + Y', | ||
Cut: 'Ctrl + X', | ||
Copy: 'Ctrl + C', | ||
Paste: 'Ctrl + V', | ||
'Select All': 'Ctrl + A', | ||
'Find/Replace': 'Ctrl + F', | ||
'Go To': 'Ctrl + G', | ||
'Full Screen': 'F11' | ||
}; | ||
</script> | ||
|
||
<Dialog.Root open={$open} onOpenChange={open.set}> | ||
<Dialog.Trigger /> | ||
|
||
<Dialog.Content> | ||
<Dialog.Header> | ||
<Dialog.Title>Shortcuts</Dialog.Title> | ||
<Dialog.Description> | ||
Here is a list of keyboard shortcuts that you can use to quickly perform actions in this | ||
application. | ||
</Dialog.Description> | ||
</Dialog.Header> | ||
|
||
<div class="w-full"> | ||
<div class="sticky top-0 bg-muted"> | ||
<Table.Root class="table w-full"> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.Head class="text-center">Function</Table.Head> | ||
<Table.Head class="text-center">Shortcuts</Table.Head> | ||
</Table.Row> | ||
</Table.Header> | ||
</Table.Root> | ||
</div> | ||
|
||
<div class="max-h-[60vh] overflow-y-auto"> | ||
<Table.Root class="table w-full"> | ||
<Table.Body> | ||
{#each Object.entries(shortcuts) as [action, shortcut]} | ||
<Table.Row> | ||
<Table.Cell class="text-center">{action}</Table.Cell> | ||
<Table.Cell class="text-center"> | ||
<Menubar.Shortcut> | ||
{shortcut} | ||
</Menubar.Shortcut> | ||
</Table.Cell> | ||
</Table.Row> | ||
{/each} | ||
</Table.Body> | ||
</Table.Root> | ||
</div> | ||
</div> | ||
</Dialog.Content> | ||
</Dialog.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.