refactor(command): use dialog (#352)
This commit is contained in:
parent
f249087a95
commit
462e85dad0
7 changed files with 110 additions and 131 deletions
|
@ -1,11 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
import {
|
||||
isCommandPanelOpen,
|
||||
isEditHistoryDialogOpen,
|
||||
isMediaPreviewOpen,
|
||||
isPreviewHelpOpen,
|
||||
isPublishDialogOpen,
|
||||
isSigninDialogOpen,
|
||||
} from '~/composables/dialog'
|
||||
|
||||
const isMac = useIsMac()
|
||||
|
||||
// TODO: temporary, await for keybind system
|
||||
// listen to ctrl+/ on windows/linux or cmd+/ on mac
|
||||
useEventListener('keydown', (e: KeyboardEvent) => {
|
||||
if (e.key === '/' && (isMac.value ? e.metaKey : e.ctrlKey)) {
|
||||
e.preventDefault()
|
||||
openCommandPanel(true)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -30,4 +42,7 @@ import {
|
|||
<ModalDialog v-model="isEditHistoryDialogOpen">
|
||||
<StatusEditPreview :edit="statusEdit" />
|
||||
</ModalDialog>
|
||||
<ModalDialog v-model="isCommandPanelOpen" max-w-fit flex>
|
||||
<CommandPanel @close="closeCommandPanel()" />
|
||||
</ModalDialog>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue