mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 15:42:24 +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
@@ -114,6 +114,7 @@ export function ConfirmButton({
|
||||
ariaLabel,
|
||||
slot,
|
||||
extra,
|
||||
destructive = false,
|
||||
}: ConfirmCopy & {
|
||||
/** The control's own label, before the dialog opens. */
|
||||
label: string;
|
||||
@@ -156,6 +157,7 @@ export function ConfirmButton({
|
||||
pending={pending}
|
||||
slot={slot}
|
||||
extra={extra}
|
||||
destructive={destructive}
|
||||
/>
|
||||
</AlertDialog>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user