feat: add post deletion confirm dialog (#818)
Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
This commit is contained in:
parent
2ff46bb8cb
commit
d76e4bfaa5
6 changed files with 78 additions and 8 deletions
|
@ -1,7 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import type { Status } from 'masto'
|
||||
import type { ConfirmDialogChoice } from '~/types'
|
||||
import {
|
||||
isCommandPanelOpen,
|
||||
isConfirmDialogOpen,
|
||||
isEditHistoryDialogOpen,
|
||||
isMediaPreviewOpen,
|
||||
isPreviewHelpOpen,
|
||||
|
@ -36,6 +38,11 @@ const handlePublished = (status: Status) => {
|
|||
const handlePublishClose = () => {
|
||||
lastPublishDialogStatus.value = null
|
||||
}
|
||||
|
||||
const handleConfirmChoice = (choice: ConfirmDialogChoice) => {
|
||||
confirmDialogChoice.value = choice
|
||||
isConfirmDialogOpen.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -71,5 +78,8 @@ const handlePublishClose = () => {
|
|||
<ModalDialog v-model="isCommandPanelOpen" max-w-fit flex>
|
||||
<CommandPanel @close="closeCommandPanel()" />
|
||||
</ModalDialog>
|
||||
<ModalDialog v-model="isConfirmDialogOpen" py-4 px-8 max-w-125>
|
||||
<ModalConfirm v-if="confirmDialogLabel" v-bind="confirmDialogLabel" @choice="handleConfirmChoice" />
|
||||
</ModalDialog>
|
||||
</template>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue