refactor: tokenize Settings danger/destructive buttons

Map the DangerButton, the Data tab destructive actions (RevokeKeys, ClearChats,
DeleteCache), and the DeleteAccount button from bg-red-*/bg-destructive to the
surface-destructive tokens.
This commit is contained in:
Marco Beretta 2026-06-19 23:54:43 +02:00
parent 76b66b224c
commit 8bb1adc67b
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
5 changed files with 5 additions and 5 deletions

View file

@ -182,7 +182,7 @@ const renderDeleteButton = (
<button
className={cn(
'mt-4 flex w-full items-center justify-center rounded-lg bg-surface-tertiary px-4 py-2 transition-all duration-200',
isLocked ? 'cursor-not-allowed opacity-30' : 'bg-destructive text-destructive-foreground',
isLocked ? 'cursor-not-allowed opacity-30' : 'bg-surface-destructive text-destructive-foreground',
)}
onClick={handleDeleteUser}
disabled={isDeleting || isLocked}

View file

@ -45,7 +45,7 @@ const DangerButton = (props: TDangerButtonProps, ref: ForwardedRef<HTMLButtonEle
disabled={disabled}
onClick={onClick}
className={cn(
'btn relative border-none bg-red-500 text-white hover:bg-red-700 dark:hover:bg-red-700',
'btn relative border-none bg-surface-destructive text-white hover:bg-surface-destructive-hover',
className,
)}
>

View file

@ -54,7 +54,7 @@ export const ClearChats = () => {
selection={{
selectHandler: clearConvos,
selectClasses:
'bg-destructive text-white transition-all duration-200 hover:bg-destructive/80',
'bg-surface-destructive text-white transition-all duration-200 hover:bg-surface-destructive-hover',
selectText: clearConvosMutation.isLoading ? <Spinner /> : localize('com_ui_delete'),
}}
/>

View file

@ -62,7 +62,7 @@ export const DeleteCache = ({ disabled = false }: { disabled?: boolean }) => {
selection={{
selectHandler: revokeAllUserKeys,
selectClasses:
'bg-destructive text-white transition-all duration-200 hover:bg-destructive/80',
'bg-surface-destructive text-white transition-all duration-200 hover:bg-surface-destructive-hover',
selectText: isLoading ? <Spinner /> : localize('com_ui_delete'),
}}
/>

View file

@ -62,7 +62,7 @@ export const RevokeKeys = ({
selection={{
selectHandler: onClick,
selectClasses:
'bg-destructive text-white transition-all duration-200 hover:bg-destructive/80',
'bg-surface-destructive text-white transition-all duration-200 hover:bg-surface-destructive-hover',
selectText: isLoading ? <Spinner /> : localize('com_ui_revoke'),
}}
/>