add destructive variant to alert dialogs for destructive actions

This commit is contained in:
pa
2026-03-13 23:10:29 +09:00
parent 9b6ca42d9d
commit 1f5acd546d
17 changed files with 77 additions and 40 deletions

View File

@@ -287,7 +287,8 @@ export function useAvatarDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.avatar.actions.block')
})
}),
destructive: true
}),
handler: (id) => {
avatarModerationRequest
@@ -369,7 +370,8 @@ export function useAvatarDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.avatar.actions.delete')
})
}),
destructive: true
}),
handler: (id) => {
avatarRequest
@@ -399,7 +401,8 @@ export function useAvatarDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.avatar.actions.delete_impostor')
})
}),
destructive: true
}),
handler: (id) => {
avatarRequest
@@ -432,7 +435,8 @@ export function useAvatarDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.avatar.actions.regenerate_impostor')
})
}),
destructive: true
}),
handler: (id) => {
avatarRequest

View File

@@ -770,7 +770,8 @@
const dashboardId = String(dashboardKey || '').replace(DASHBOARD_NAV_KEY_PREFIX, '');
const { ok } = await modalStore.confirm({
title: t('dashboard.confirmations.delete_title'),
description: t('dashboard.confirmations.delete_description')
description: t('dashboard.confirmations.delete_description'),
destructive: true
});
if (!ok) {
return;

View File

@@ -561,7 +561,8 @@
modalStore
.confirm({
description: t('confirm.delete_post'),
title: t('confirm.title')
title: t('confirm.title'),
destructive: true
})
.then(({ ok }) => {
if (!ok) return;

View File

@@ -84,7 +84,8 @@ export function useGroupDialogCommands(
'Block Group': {
confirm: () => ({
title: t('confirm.title'),
description: t('confirm.block_group')
description: t('confirm.block_group'),
destructive: true
}),
handler: (id) => {
groupRequest.blockGroup({ groupId: id }).then((args) => {

View File

@@ -486,7 +486,8 @@ export function useUserDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.user.actions.moderation_block')
})
}),
destructive: true
}),
handler: async (userId) => {
const args =
@@ -518,7 +519,8 @@ export function useUserDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.user.actions.moderation_mute')
})
}),
destructive: true
}),
handler: async (userId) => {
const args =
@@ -554,7 +556,8 @@ export function useUserDialogCommands(
command: t(
'dialog.user.actions.moderation_disable_avatar_interaction'
)
})
}),
destructive: true
}),
handler: async (userId) => {
const args =
@@ -590,7 +593,8 @@ export function useUserDialogCommands(
command: t(
'dialog.user.actions.moderation_disable_chatbox'
)
})
}),
destructive: true
}),
handler: async (userId) => {
const args =
@@ -622,7 +626,8 @@ export function useUserDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.user.actions.unfriend')
})
}),
destructive: true
}),
handler: async (userId) => {
const args = await friendRequest.deleteFriend(

View File

@@ -528,7 +528,8 @@ export function useWorldDialogCommands(
title: t('confirm.title'),
description: t('confirm.command_question', {
command: t('dialog.world.actions.delete')
})
}),
destructive: true
}),
handler: (id) => {
worldRequest.deleteWorld({ worldId: id }).then((args) => {