mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
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:
parent
76b66b224c
commit
8bb1adc67b
5 changed files with 5 additions and 5 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue