From e5e5663ca9ccd3dfb764333fc6156f68cb2d7289 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Tue, 6 Jan 2026 12:09:34 +0100 Subject: [PATCH] style: refactor dialog components to use OGDialogFooter for improved layout consistency --- .../ConvoOptions/DeleteButton.tsx | 5 +- .../ConvoOptions/SharedLinkButton.tsx | 21 +-- .../SidePanel/Agents/Code/ApiKeyDialog.tsx | 150 ++++++++++-------- .../client/src/components/OriginalDialog.tsx | 2 +- 4 files changed, 96 insertions(+), 82 deletions(-) diff --git a/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx b/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx index 002d555455..01185819c3 100644 --- a/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx +++ b/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx @@ -10,6 +10,7 @@ import { OGDialogClose, OGDialogTitle, OGDialogHeader, + OGDialogFooter, OGDialogContent, useToastContext, } from '@librechat/client'; @@ -96,7 +97,7 @@ export function DeleteConversationDialog({ components={{ strong: }} /> -
+ -
+ ); } diff --git a/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx b/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx index 7c53cab64c..44d896c3cf 100644 --- a/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx +++ b/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx @@ -10,8 +10,9 @@ import { TooltipAnchor, OGDialogTitle, OGDialogHeader, - useToastContext, + OGDialogFooter, OGDialogContent, + useToastContext, } from '@librechat/client'; import type { TSharedLinkGetResponse } from 'librechat-data-provider'; import { @@ -132,12 +133,6 @@ export default function SharedLinkButton({ return ( <>
- {!shareId && ( - - )} {shareId && (
)} + {!shareId && ( + + + + )}
-
+ @@ -229,7 +232,7 @@ export default function SharedLinkButton({ localize('com_ui_delete') )} -
+ diff --git a/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx b/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx index 70f114ae44..282f17b0d3 100644 --- a/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx +++ b/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx @@ -1,9 +1,32 @@ -import { OGDialogTemplate, Input, Button, OGDialog } from '@librechat/client'; +import { + Button, + OGDialog, + SecretInput, + OGDialogClose, + OGDialogTitle, + OGDialogFooter, + OGDialogHeader, + OGDialogContent, + OGDialogDescription, +} from '@librechat/client'; import type { UseFormRegister, UseFormHandleSubmit } from 'react-hook-form'; import type { ApiKeyFormData } from '~/common'; import type { RefObject } from 'react'; import { useLocalize } from '~/hooks'; +const languageIcons = [ + 'python.svg', + 'nodedotjs.svg', + 'tsnode.svg', + 'rust.svg', + 'go.svg', + 'c.svg', + 'cplusplus.svg', + 'php.svg', + 'fortran.svg', + 'r.svg', +]; + export default function ApiKeyDialog({ isOpen, onSubmit, @@ -28,18 +51,6 @@ export default function ApiKeyDialog({ triggerRefs?: RefObject[]; }) { const localize = useLocalize(); - const languageIcons = [ - 'python.svg', - 'nodedotjs.svg', - 'tsnode.svg', - 'rust.svg', - 'go.svg', - 'c.svg', - 'cplusplus.svg', - 'php.svg', - 'fortran.svg', - 'r.svg', - ]; return ( - -
- {localize('com_ui_librechat_code_api_title')} -
-
- {localize('com_ui_librechat_code_api_subtitle')} -
- {/* Language Icons Stack */} -
-
- {languageIcons.map((icon) => ( -
- -
- ))} + + + + {localize('com_ui_librechat_code_api_title')} + +
+ {languageIcons.map((icon) => ( +
+
- - {localize('com_ui_librechat_code_api_key')} - -
-
- (e.target.readOnly = false)} - {...register('apiKey', { required: true })} - /> -
- - } - selection={{ - selectHandler: handleSubmit(onSubmit), - selectClasses: 'bg-green-500 hover:bg-green-600 text-white', - selectText: localize('com_ui_save'), - }} - buttons={ - isUserProvided && - isToolAuthenticated && ( + ))} +
+ + {localize('com_ui_librechat_code_api_subtitle')} + + + + + + + + + + {isUserProvided && isToolAuthenticated && ( - ) - } - showCancelButton={true} - /> + )} + + + ); } diff --git a/packages/client/src/components/OriginalDialog.tsx b/packages/client/src/components/OriginalDialog.tsx index 451c87c227..5d5fe8397b 100644 --- a/packages/client/src/components/OriginalDialog.tsx +++ b/packages/client/src/components/OriginalDialog.tsx @@ -168,7 +168,7 @@ DialogHeader.displayName = 'DialogHeader'; const DialogFooter = ({ className, ...props }: React.HTMLAttributes) => (
);