diff --git a/src/components/features/backends/backend-form-modal.tsx b/src/components/features/backends/backend-form-modal.tsx index 49496523..0ce99982 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"; @@ -22,9 +21,6 @@ import { cn } from "#/utils/utils"; 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 { @@ -606,23 +602,17 @@ export function BackendFormModal({
+ {/* Header */} -
- - +
+

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

{/* Two-column body */} @@ -662,22 +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 dee6e445..7702708c 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,10 +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"; - -const ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed"; interface OpenRepositoryModalProps { isOpen: boolean; @@ -101,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 fcda51d3..949727e1 100644 --- a/src/components/features/conversation-panel/hooks-modal-header.tsx +++ b/src/components/features/conversation-panel/hooks-modal-header.tsx @@ -1,6 +1,7 @@ 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 { I18nKey } from "#/i18n/declaration"; import { Typography } from "#/ui/typography"; @@ -26,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 cc38e4e2..33926799 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) { -
- - - {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 d10c96d7..16b40243 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) { void; } -const ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer"; - export function SystemMessageHeader({ agentClass, openhandsVersion, @@ -21,8 +18,9 @@ export function SystemMessageHeader({ const { t } = useTranslation("openhands"); return ( -
-
+ <> + +
{(agentClass || openhandsVersion) && (
@@ -49,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 81e7689d..85c4f29d 100644 --- a/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx +++ b/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx @@ -1,30 +1,21 @@ import { useTranslation } from "react-i18next"; -import { X } from "lucide-react"; import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal"; +import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { I18nKey } from "#/i18n/declaration"; interface MetricsModalHeaderProps { onClose: () => void; } -const ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer"; - 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 2732deea..5d8ee8f4 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 1df8295a..a297126e 100644 --- a/src/components/features/home/open-repository-dialog.tsx +++ b/src/components/features/home/open-repository-dialog.tsx @@ -1,14 +1,10 @@ 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"; - -const ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed"; import { Provider } from "#/types/settings"; import { useUserProviders } from "#/hooks/use-user-providers"; import { RepositorySelectionForm } from "./repo-selection-form"; @@ -37,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 dd46a6bc..ed93ddfa 100644 --- a/src/components/features/home/open-workspace-dialog.tsx +++ b/src/components/features/home/open-workspace-dialog.tsx @@ -1,17 +1,13 @@ 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 { WorkspaceSelectionForm } from "./workspace-selection-form"; -const ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed"; - interface OpenWorkspaceDialogProps { isOpen: boolean; onClose: () => void; @@ -32,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 96ff4831..eac99c90 100644 --- a/src/components/features/launch/plugin-launch-modal.tsx +++ b/src/components/features/launch/plugin-launch-modal.tsx @@ -1,11 +1,11 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { IoClose } from "react-icons/io5"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { MODAL_MAX_WIDTH_VIEWPORT, modalWidthClassName, } from "#/components/shared/modals/modal-body"; +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"; @@ -131,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/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsx index 0bafe174..13259b5b 100644 --- a/src/components/features/mcp-page/install-server-modal.tsx +++ b/src/components/features/mcp-page/install-server-modal.tsx @@ -1,7 +1,6 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { AxiosError } from "axios"; -import { X } from "lucide-react"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalCloseButton } from "#/components/shared/modals/modal-close-button"; import { BrandButton } from "#/components/features/settings/brand-button"; @@ -14,9 +13,6 @@ import { useAddMcpServer } from "#/hooks/mutation/use-add-mcp-server"; import { displaySuccessToast } from "#/utils/custom-toast-handlers"; import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message"; -const ICON_BUTTON_CLASS = - "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed"; - interface InstallServerModalProps { entry: MarketplaceEntry; onClose: () => void; @@ -286,16 +282,6 @@ export function InstallServerModal({

{entry.name}

{entry.description}

-
{entry.installHint && (