mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
fix(ui): let ConfirmButton's dialog wear the destructive style
ConfirmButton took a `destructive` prop and dropped it on the way to its dialog, so every delete, revoke and remove built on it confirmed with a neutral primary button while ConfirmDialog confirmed the same kind of act in red. The prop is forwarded now, and the call sites whose act takes something away pass it. A guard holds every confirmation whose slot names a destroying act to the destructive style; resets stay neutral.
This commit is contained in:
1 parent
dc704b5e63
commit
9a8b95cfd0
21 files changed
+181
No files matched your search
@@ -127,6 +127,7 @@ export function GrantsGivenCard() {
|
||||
return (
|
||||
<ConfirmButton
|
||||
slot="grant-revoke"
|
||||
destructive
|
||||
size="sm"
|
||||
label={
|
||||
grant.state === "PENDING"
|
||||
|
||||
@@ -229,6 +229,7 @@ export function GrantsReceivedCard() {
|
||||
</Button>
|
||||
<ConfirmButton
|
||||
slot="grant-renounce"
|
||||
destructive
|
||||
size="sm"
|
||||
label={t("recordSharing.received.renounce")}
|
||||
title={t("recordSharing.received.renounceTitle", { name })}
|
||||
|
||||
@@ -188,6 +188,7 @@ function ManagedProfileRow({
|
||||
{guardians.data && (
|
||||
<ConfirmButton
|
||||
slot="managed-profile-delete"
|
||||
destructive
|
||||
size="sm"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
label={t("recordSharing.managed.delete")}
|
||||
|
||||
@@ -172,6 +172,7 @@ export function ManagedProfileGuardians({
|
||||
<div className="flex shrink-0 items-center">
|
||||
<ConfirmButton
|
||||
slot="managed-profile-guardian-remove"
|
||||
destructive
|
||||
size="sm"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
label={t("recordSharing.managed.guardianRemove")}
|
||||
|
||||
@@ -154,6 +154,7 @@ export function AvatarSection() {
|
||||
{avatarUrl && (
|
||||
<ConfirmButton
|
||||
slot="settings-avatar-remove"
|
||||
destructive
|
||||
variant="ghost"
|
||||
className="text-destructive min-h-11 sm:min-h-9"
|
||||
icon={<Trash2 className="h-4 w-4" />}
|
||||
|
||||
@@ -210,6 +210,7 @@ export function CodexProviderForm({
|
||||
) : isConnected ? (
|
||||
<ConfirmButton
|
||||
slot="settings-codex-disconnect"
|
||||
destructive
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="text-destructive min-h-11 shrink-0 sm:min-h-9"
|
||||
|
||||
@@ -228,6 +228,7 @@ function FactRow({
|
||||
accessible name and the confirmation carry the words. */}
|
||||
<ConfirmButton
|
||||
slot="settings-coach-memory-forget"
|
||||
destructive
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="size-11 sm:size-9"
|
||||
|
||||
@@ -147,6 +147,7 @@ export function CoachRemindersSection({
|
||||
)}
|
||||
<ConfirmButton
|
||||
slot="coach-reminder-delete"
|
||||
destructive
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-muted-foreground hover:text-foreground min-h-9"
|
||||
|
||||
@@ -450,6 +450,7 @@ export function EnvironmentSection() {
|
||||
</span>
|
||||
<ConfirmButton
|
||||
slot="travel-remove"
|
||||
destructive
|
||||
size="icon"
|
||||
variant="ghost"
|
||||
className="min-h-11 min-w-11 sm:min-h-9 sm:min-w-9"
|
||||
|
||||
@@ -216,6 +216,7 @@ export function SecuritySessionsCard({
|
||||
{!s.isCurrent && (
|
||||
<ConfirmButton
|
||||
slot="revoke-session"
|
||||
destructive
|
||||
size="sm"
|
||||
className="min-h-9 shrink-0"
|
||||
label={t("settings.security.revokeSession")}
|
||||
@@ -237,6 +238,7 @@ export function SecuritySessionsCard({
|
||||
<SettingsCardActions>
|
||||
<ConfirmButton
|
||||
slot="sign-out-everywhere"
|
||||
destructive
|
||||
className="min-h-11 sm:min-h-9"
|
||||
label={t("settings.security.signOutEverywhere")}
|
||||
title={t("settings.security.signOutEverywhereConfirmTitle")}
|
||||
|
||||
@@ -137,6 +137,7 @@ export function TrustedDevicesCard({
|
||||
</div>
|
||||
<ConfirmButton
|
||||
slot="revoke-trusted-device"
|
||||
destructive
|
||||
size="sm"
|
||||
className="min-h-9 shrink-0"
|
||||
label={t("settings.security.trustedDevices.revoke")}
|
||||
@@ -157,6 +158,7 @@ export function TrustedDevicesCard({
|
||||
<SettingsCardActions>
|
||||
<ConfirmButton
|
||||
slot="revoke-all-trusted-devices"
|
||||
destructive
|
||||
className="min-h-11 sm:min-h-9"
|
||||
label={t("settings.security.trustedDevices.revokeAll")}
|
||||
title={t(
|
||||
|
||||
Reference in new issue
Block a user