From ac86d3ecd11c7a4f33e634073b7f6f2578643558 Mon Sep 17 00:00:00 2001 From: hieptl Date: Sun, 24 May 2026 01:46:41 +0700 Subject: [PATCH 1/2] fix: unify modal close button and title styling --- .../automations/add-automation-modal.tsx | 23 +++++++----- .../features/backends/backend-form-modal.tsx | 18 ++++++---- .../backends/manage-backends-modal.tsx | 6 ++-- .../features/chat/open-repository-modal.tsx | 6 ++-- .../conversation-panel/hooks-modal-header.tsx | 11 +++--- .../skills-modal-header.tsx | 11 +++--- .../system-message-header.tsx | 6 ++-- .../metrics-modal/metrics-modal-header.tsx | 6 ++-- .../features/home/open-repository-dialog.tsx | 6 ++-- .../features/home/open-workspace-dialog.tsx | 6 ++-- .../features/launch/plugin-launch-modal.tsx | 7 ++-- .../mcp-page/custom-server-editor.tsx | 33 ++++++++++------- .../mcp-page/install-server-modal.tsx | 23 +++++------- .../features/skills/add-skill-modal.tsx | 23 ++++++++---- .../features/skills/skill-detail-modal.tsx | 19 +++++++--- .../shared/modals/modal-close-button.tsx | 36 ------------------- .../shared/modals/modal-icon-button-class.ts | 2 ++ src/icons/modal-close.svg | 3 -- 18 files changed, 116 insertions(+), 129 deletions(-) delete mode 100644 src/components/shared/modals/modal-close-button.tsx create mode 100644 src/components/shared/modals/modal-icon-button-class.ts delete mode 100644 src/icons/modal-close.svg diff --git a/src/components/features/automations/add-automation-modal.tsx b/src/components/features/automations/add-automation-modal.tsx index 0cbf0d982..0a5b1a1a5 100644 --- a/src/components/features/automations/add-automation-modal.tsx +++ b/src/components/features/automations/add-automation-modal.tsx @@ -1,7 +1,9 @@ import { useTranslation } from "react-i18next"; +import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; +import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { I18nKey } from "#/i18n/declaration"; +import { cn } from "#/utils/utils"; import { CreateInstructionsContent } from "./create-instructions"; interface AddAutomationModalProps { @@ -24,19 +26,24 @@ export function AddAutomationModal({ >
- -
+

{t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}

+
diff --git a/src/components/features/backends/backend-form-modal.tsx b/src/components/features/backends/backend-form-modal.tsx index 494965230..c61e7e0da 100644 --- a/src/components/features/backends/backend-form-modal.tsx +++ b/src/components/features/backends/backend-form-modal.tsx @@ -19,12 +19,10 @@ import ChevronDownSmallIcon from "#/icons/chevron-down-small.svg?react"; import { I18nKey } from "#/i18n/declaration"; import type { Backend, BackendKind } from "#/api/backend-registry/types"; import { cn } from "#/utils/utils"; +import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { BackendStatusDot } from "./backend-status-dot"; import { DeviceFlowAuth } from "./device-flow-auth"; -const ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer"; - export type BackendFormMode = "add" | "edit"; interface BackendFormModalProps { @@ -613,11 +611,14 @@ export function BackendFormModal({ > {/* Header */}
- +
diff --git a/src/components/features/mcp-page/custom-server-editor.tsx b/src/components/features/mcp-page/custom-server-editor.tsx index 8ddfba9e5..140c361c8 100644 --- a/src/components/features/mcp-page/custom-server-editor.tsx +++ b/src/components/features/mcp-page/custom-server-editor.tsx @@ -1,11 +1,13 @@ import React from "react"; import { AxiosError } from "axios"; import { useTranslation } from "react-i18next"; +import { X } from "lucide-react"; import { I18nKey } from "#/i18n/declaration"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; +import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { ConfirmationModal } from "#/components/shared/modals/confirmation-modal"; import { MCPServerForm } from "#/components/features/settings/mcp-settings/mcp-server-form"; +import { cn } from "#/utils/utils"; import { useAddMcpServer } from "#/hooks/mutation/use-add-mcp-server"; import { useUpdateMcpServer } from "#/hooks/mutation/use-update-mcp-server"; import { useDeleteMcpServer } from "#/hooks/mutation/use-delete-mcp-server"; @@ -94,18 +96,25 @@ export function CustomServerEditor({ >
- -

- {isEditing - ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE) - : t(I18nKey.MCP$ADD_CUSTOM_TITLE)} -

+
+

+ {isEditing + ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE) + : t(I18nKey.MCP$ADD_CUSTOM_TITLE)} +

+ +
- -
+
-
-

{entry.name}

+
+

{entry.name}

{entry.description}

diff --git a/src/components/features/skills/add-skill-modal.tsx b/src/components/features/skills/add-skill-modal.tsx index 585dc5c88..f3dbe990c 100644 --- a/src/components/features/skills/add-skill-modal.tsx +++ b/src/components/features/skills/add-skill-modal.tsx @@ -1,7 +1,8 @@ import React from "react"; import { Trans, useTranslation } from "react-i18next"; +import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; +import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { BrandButton } from "#/components/features/settings/brand-button"; import { ADD_SKILL_DOCS_URL, @@ -120,13 +121,23 @@ export function AddSkillModal({ onClose }: AddSkillModalProps) { >
-
-

- {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_TITLE)} -

+
+

+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_TITLE)} +

+ +

{t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_INTRO)}

diff --git a/src/components/features/skills/skill-detail-modal.tsx b/src/components/features/skills/skill-detail-modal.tsx index f81ce71c0..1886039d5 100644 --- a/src/components/features/skills/skill-detail-modal.tsx +++ b/src/components/features/skills/skill-detail-modal.tsx @@ -1,7 +1,8 @@ import React from "react"; import { useTranslation } from "react-i18next"; +import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; +import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { BrandButton } from "#/components/features/settings/brand-button"; import { SettingsSwitch } from "#/components/features/settings/settings-switch"; import { I18nKey } from "#/i18n/declaration"; @@ -99,15 +100,14 @@ export function SkillDetailModal({
- -
+

{skill.name}

@@ -143,6 +143,15 @@ export function SkillDetailModal({
) : null}
+
void; - testId?: string; - className?: string; - disabled?: boolean; -} - -export function ModalCloseButton({ - onClose, - testId, - className, - disabled = false, -}: ModalCloseButtonProps) { - const { t } = useTranslation("openhands"); - - return ( - - ); -} diff --git a/src/components/shared/modals/modal-icon-button-class.ts b/src/components/shared/modals/modal-icon-button-class.ts new file mode 100644 index 000000000..3b28ecfe6 --- /dev/null +++ b/src/components/shared/modals/modal-icon-button-class.ts @@ -0,0 +1,2 @@ +export const MODAL_ICON_BUTTON_CLASS = + "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer"; diff --git a/src/icons/modal-close.svg b/src/icons/modal-close.svg deleted file mode 100644 index 0430d6441..000000000 --- a/src/icons/modal-close.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - From fce32064ebecb70d6ce69d393ae7254353da5f7b Mon Sep 17 00:00:00 2001 From: hieptl Date: Sun, 24 May 2026 03:09:48 +0700 Subject: [PATCH 2/2] revert: white-icon modal styling and standardize on ModalCloseButton --- .../automations/add-automation-modal.tsx | 23 ++++------ .../features/backends/backend-form-modal.tsx | 46 +++++-------------- .../backends/manage-backends-modal.tsx | 29 +++++------- .../features/chat/open-repository-modal.tsx | 21 +++------ .../conversation-panel/hooks-modal-header.tsx | 40 +++++++--------- .../conversation-panel/hooks-modal.tsx | 2 +- .../skills-modal-header.tsx | 40 +++++++--------- .../conversation-panel/skills-modal.tsx | 2 +- .../system-message-modal.tsx | 2 +- .../system-message-header.tsx | 19 ++------ .../metrics-modal/metrics-modal-header.tsx | 21 +++------ .../metrics-modal/metrics-modal.tsx | 2 +- .../features/home/open-repository-dialog.tsx | 21 +++------ .../features/home/open-workspace-dialog.tsx | 21 +++------ .../features/launch/plugin-launch-modal.tsx | 23 +++------- .../mcp-page/custom-server-editor.tsx | 33 +++++-------- .../mcp-page/install-server-modal.tsx | 27 ++++------- .../features/skills/add-skill-modal.tsx | 23 +++------- .../features/skills/skill-detail-modal.tsx | 19 ++------ .../shared/modals/modal-close-button.tsx | 36 +++++++++++++++ .../shared/modals/modal-icon-button-class.ts | 2 - src/icons/modal-close.svg | 3 ++ 22 files changed, 178 insertions(+), 277 deletions(-) create mode 100644 src/components/shared/modals/modal-close-button.tsx delete mode 100644 src/components/shared/modals/modal-icon-button-class.ts create mode 100644 src/icons/modal-close.svg diff --git a/src/components/features/automations/add-automation-modal.tsx b/src/components/features/automations/add-automation-modal.tsx index 0a5b1a1a5..0cbf0d982 100644 --- a/src/components/features/automations/add-automation-modal.tsx +++ b/src/components/features/automations/add-automation-modal.tsx @@ -1,9 +1,7 @@ import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { I18nKey } from "#/i18n/declaration"; -import { cn } from "#/utils/utils"; import { CreateInstructionsContent } from "./create-instructions"; interface AddAutomationModalProps { @@ -26,24 +24,19 @@ export function AddAutomationModal({ >
-
+ +

{t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}

-
diff --git a/src/components/features/backends/backend-form-modal.tsx b/src/components/features/backends/backend-form-modal.tsx index c61e7e0da..0ce99982d 100644 --- a/src/components/features/backends/backend-form-modal.tsx +++ b/src/components/features/backends/backend-form-modal.tsx @@ -1,7 +1,6 @@ import React from "react"; import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ServerClient } from "@openhands/typescript-client/clients"; import OpenHandsLogoWhite from "#/assets/branding/openhands-logo-white.svg?react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; @@ -9,7 +8,7 @@ import { MODAL_MAX_WIDTH_VIEWPORT, modalWidthClassName, } from "#/components/shared/modals/modal-body"; -import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BrandButton } from "#/components/features/settings/brand-button"; import { SettingsInput } from "#/components/features/settings/settings-input"; import { useActiveBackendContext } from "#/contexts/active-backend-context"; @@ -19,7 +18,6 @@ import ChevronDownSmallIcon from "#/icons/chevron-down-small.svg?react"; import { I18nKey } from "#/i18n/declaration"; import type { Backend, BackendKind } from "#/api/backend-registry/types"; import { cn } from "#/utils/utils"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { BackendStatusDot } from "./backend-status-dot"; import { DeviceFlowAuth } from "./device-flow-auth"; @@ -604,26 +602,17 @@ export function BackendFormModal({
+ {/* Header */} -
- - +
+

+ {t(I18nKey.BACKEND$ADD_TITLE)} +

{/* Two-column body */} @@ -663,25 +652,14 @@ export function BackendFormModal({
-
- - -
+ +

+ {t(I18nKey.BACKEND$EDIT_TITLE)} +

-
- - + +
+

+ {t(I18nKey.BACKEND$MANAGE_TITLE)} +

diff --git a/src/components/features/chat/open-repository-modal.tsx b/src/components/features/chat/open-repository-modal.tsx index ff1845944..7702708c9 100644 --- a/src/components/features/chat/open-repository-modal.tsx +++ b/src/components/features/chat/open-repository-modal.tsx @@ -1,8 +1,8 @@ import React, { useState, useCallback, useEffect } from "react"; import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalBody } from "#/components/shared/modals/modal-body"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BrandButton } from "#/components/features/settings/brand-button"; import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal"; import { I18nKey } from "#/i18n/declaration"; @@ -12,8 +12,6 @@ import { GitRepoDropdown } from "#/components/features/home/git-repo-dropdown/gi import { GitBranchDropdown } from "#/components/features/home/git-branch-dropdown/git-branch-dropdown"; import { GitProviderDropdown } from "#/components/features/home/git-provider-dropdown/git-provider-dropdown"; import { useUserProviders } from "#/hooks/use-user-providers"; -import { cn } from "#/utils/utils"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; interface OpenRepositoryModalProps { isOpen: boolean; @@ -99,19 +97,14 @@ export function OpenRepositoryModal({ -
+ +
-
diff --git a/src/components/features/conversation-panel/hooks-modal-header.tsx b/src/components/features/conversation-panel/hooks-modal-header.tsx index 474eecd18..949727e13 100644 --- a/src/components/features/conversation-panel/hooks-modal-header.tsx +++ b/src/components/features/conversation-panel/hooks-modal-header.tsx @@ -1,8 +1,8 @@ import { useTranslation } from "react-i18next"; -import { RefreshCw, X } from "lucide-react"; +import { RefreshCw } from "lucide-react"; import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { I18nKey } from "#/i18n/declaration"; import { Typography } from "#/ui/typography"; import { cn } from "#/utils/utils"; @@ -14,6 +14,9 @@ interface HooksModalHeaderProps { onClose: () => void; } +const ICON_BUTTON_CLASS = + "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed"; + export function HooksModalHeader({ isLoading, isRefetching, @@ -24,14 +27,15 @@ export function HooksModalHeader({ const refreshLabel = t(I18nKey.BUTTON$REFRESH); return ( -
-
- - - {t(I18nKey.HOOKS_MODAL$WARNING)} - -
-
+ <> + +
+
+ + + {t(I18nKey.HOOKS_MODAL$WARNING)} + +
-
-
+ ); } diff --git a/src/components/features/conversation-panel/hooks-modal.tsx b/src/components/features/conversation-panel/hooks-modal.tsx index cc38e4e2a..33926799f 100644 --- a/src/components/features/conversation-panel/hooks-modal.tsx +++ b/src/components/features/conversation-panel/hooks-modal.tsx @@ -42,7 +42,7 @@ export function HooksModal({ onClose }: HooksModalProps) { void; } +const ICON_BUTTON_CLASS = + "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed"; + export function SkillsModalHeader({ isLoading, isRefetching, @@ -24,14 +27,15 @@ export function SkillsModalHeader({ const refreshLabel = t(I18nKey.BUTTON$REFRESH); return ( -
-
- - - {t(I18nKey.SKILLS_MODAL$WARNING)} - -
-
+ <> + +
+
+ + + {t(I18nKey.SKILLS_MODAL$WARNING)} + +
-
-
+ ); } diff --git a/src/components/features/conversation-panel/skills-modal.tsx b/src/components/features/conversation-panel/skills-modal.tsx index d10c96d70..16b402435 100644 --- a/src/components/features/conversation-panel/skills-modal.tsx +++ b/src/components/features/conversation-panel/skills-modal.tsx @@ -64,7 +64,7 @@ export function SkillsModal({ onClose }: SkillsModalProps) { -
+ <> + +
{(agentClass || openhandsVersion) && (
@@ -47,15 +47,6 @@ export function SystemMessageHeader({
)}
- -
+ ); } diff --git a/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx b/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx index c71900b0b..85c4f29df 100644 --- a/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx +++ b/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx @@ -1,7 +1,6 @@ import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { I18nKey } from "#/i18n/declaration"; interface MetricsModalHeaderProps { @@ -12,17 +11,11 @@ export function MetricsModalHeader({ onClose }: MetricsModalHeaderProps) { const { t } = useTranslation("openhands"); return ( -
- - -
+ <> + +
+ +
+ ); } diff --git a/src/components/features/conversation/metrics-modal/metrics-modal.tsx b/src/components/features/conversation/metrics-modal/metrics-modal.tsx index 2732deeaa..5d8ee8f40 100644 --- a/src/components/features/conversation/metrics-modal/metrics-modal.tsx +++ b/src/components/features/conversation/metrics-modal/metrics-modal.tsx @@ -66,7 +66,7 @@ export function MetricsModal({ isOpen, onOpenChange }: MetricsModalProps) { onOpenChange(false)}> onOpenChange(false)} />
diff --git a/src/components/features/home/open-repository-dialog.tsx b/src/components/features/home/open-repository-dialog.tsx index 66eedfea3..a297126ec 100644 --- a/src/components/features/home/open-repository-dialog.tsx +++ b/src/components/features/home/open-repository-dialog.tsx @@ -1,14 +1,12 @@ import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalBody } from "#/components/shared/modals/modal-body"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal"; import { I18nKey } from "#/i18n/declaration"; -import { cn } from "#/utils/utils"; import { Branch, GitRepository } from "#/types/git"; import { Provider } from "#/types/settings"; import { useUserProviders } from "#/hooks/use-user-providers"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { RepositorySelectionForm } from "./repo-selection-form"; interface OpenRepositoryDialogProps { @@ -35,19 +33,14 @@ export function OpenRepositoryDialog({ -
+ +
-
diff --git a/src/components/features/home/open-workspace-dialog.tsx b/src/components/features/home/open-workspace-dialog.tsx index 1556f0965..ed93ddfa8 100644 --- a/src/components/features/home/open-workspace-dialog.tsx +++ b/src/components/features/home/open-workspace-dialog.tsx @@ -1,13 +1,11 @@ import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalBody } from "#/components/shared/modals/modal-body"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal"; import { I18nKey } from "#/i18n/declaration"; -import { cn } from "#/utils/utils"; import { LocalWorkspace } from "#/types/workspace"; import { useUserProviders } from "#/hooks/use-user-providers"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; import { WorkspaceSelectionForm } from "./workspace-selection-form"; interface OpenWorkspaceDialogProps { @@ -30,19 +28,14 @@ export function OpenWorkspaceDialog({ -
+ +
-
diff --git a/src/components/features/launch/plugin-launch-modal.tsx b/src/components/features/launch/plugin-launch-modal.tsx index bfa97599d..eac99c905 100644 --- a/src/components/features/launch/plugin-launch-modal.tsx +++ b/src/components/features/launch/plugin-launch-modal.tsx @@ -1,12 +1,11 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { MODAL_MAX_WIDTH_VIEWPORT, modalWidthClassName, } from "#/components/shared/modals/modal-body"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BrandButton } from "#/components/features/settings/brand-button"; import { I18nKey } from "#/i18n/declaration"; import { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types"; @@ -132,25 +131,15 @@ export function PluginLaunchModal({
-
- - {t(I18nKey.LAUNCH$MODAL_TITLE)} {modalTitle} - - -
+ + + {t(I18nKey.LAUNCH$MODAL_TITLE)} {modalTitle} + {message &&

{message}

} diff --git a/src/components/features/mcp-page/custom-server-editor.tsx b/src/components/features/mcp-page/custom-server-editor.tsx index 140c361c8..8ddfba9e5 100644 --- a/src/components/features/mcp-page/custom-server-editor.tsx +++ b/src/components/features/mcp-page/custom-server-editor.tsx @@ -1,13 +1,11 @@ import React from "react"; import { AxiosError } from "axios"; import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { I18nKey } from "#/i18n/declaration"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { ConfirmationModal } from "#/components/shared/modals/confirmation-modal"; import { MCPServerForm } from "#/components/features/settings/mcp-settings/mcp-server-form"; -import { cn } from "#/utils/utils"; import { useAddMcpServer } from "#/hooks/mutation/use-add-mcp-server"; import { useUpdateMcpServer } from "#/hooks/mutation/use-update-mcp-server"; import { useDeleteMcpServer } from "#/hooks/mutation/use-delete-mcp-server"; @@ -96,25 +94,18 @@ export function CustomServerEditor({ >
-
-

- {isEditing - ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE) - : t(I18nKey.MCP$ADD_CUSTOM_TITLE)} -

- -
+ +

+ {isEditing + ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE) + : t(I18nKey.MCP$ADD_CUSTOM_TITLE)} +

-
+ +
-
-

{entry.name}

+
+

{entry.name}

{entry.description}

-
{entry.installHint && ( diff --git a/src/components/features/skills/add-skill-modal.tsx b/src/components/features/skills/add-skill-modal.tsx index f3dbe990c..585dc5c88 100644 --- a/src/components/features/skills/add-skill-modal.tsx +++ b/src/components/features/skills/add-skill-modal.tsx @@ -1,8 +1,7 @@ import React from "react"; import { Trans, useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BrandButton } from "#/components/features/settings/brand-button"; import { ADD_SKILL_DOCS_URL, @@ -121,23 +120,13 @@ export function AddSkillModal({ onClose }: AddSkillModalProps) { >
+
-
-

- {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_TITLE)} -

- -
+

+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_TITLE)} +

{t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_INTRO)}

diff --git a/src/components/features/skills/skill-detail-modal.tsx b/src/components/features/skills/skill-detail-modal.tsx index 1886039d5..f81ce71c0 100644 --- a/src/components/features/skills/skill-detail-modal.tsx +++ b/src/components/features/skills/skill-detail-modal.tsx @@ -1,8 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; -import { MODAL_ICON_BUTTON_CLASS } from "#/components/shared/modals/modal-icon-button-class"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BrandButton } from "#/components/features/settings/brand-button"; import { SettingsSwitch } from "#/components/features/settings/settings-switch"; import { I18nKey } from "#/i18n/declaration"; @@ -100,14 +99,15 @@ export function SkillDetailModal({
-
+ +

{skill.name}

@@ -143,15 +143,6 @@ export function SkillDetailModal({
) : null}
-
void; + testId?: string; + className?: string; + disabled?: boolean; +} + +export function ModalCloseButton({ + onClose, + testId, + className, + disabled = false, +}: ModalCloseButtonProps) { + const { t } = useTranslation("openhands"); + + return ( + + ); +} diff --git a/src/components/shared/modals/modal-icon-button-class.ts b/src/components/shared/modals/modal-icon-button-class.ts deleted file mode 100644 index 3b28ecfe6..000000000 --- a/src/components/shared/modals/modal-icon-button-class.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const MODAL_ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer"; diff --git a/src/icons/modal-close.svg b/src/icons/modal-close.svg new file mode 100644 index 000000000..0430d6441 --- /dev/null +++ b/src/icons/modal-close.svg @@ -0,0 +1,3 @@ + + +