mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 23:38:08 -05:00
chore(frontend): Replace deprecated nextui component prop onClick with onPress (#5851)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Button } from "@nextui-org/react";
|
||||
import React, { MouseEventHandler, ReactElement } from "react";
|
||||
import React, { ReactElement } from "react";
|
||||
|
||||
export interface IconButtonProps {
|
||||
icon: ReactElement;
|
||||
onClick: MouseEventHandler<HTMLButtonElement>;
|
||||
onClick: () => void;
|
||||
ariaLabel: string;
|
||||
testId?: string;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ export function IconButton({
|
||||
<Button
|
||||
type="button"
|
||||
variant="flat"
|
||||
onClick={onClick}
|
||||
onPress={onClick}
|
||||
className="cursor-pointer text-[12px] bg-transparent aspect-square px-0 min-w-[20px] h-[20px]"
|
||||
aria-label={ariaLabel}
|
||||
data-testid={testId}
|
||||
|
||||
@@ -23,7 +23,7 @@ export function FooterContent({ actions, closeModal }: FooterContentProps) {
|
||||
key={label}
|
||||
type="button"
|
||||
isDisabled={isDisabled}
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
action();
|
||||
if (closeAfterAction) closeModal();
|
||||
}}
|
||||
|
||||
@@ -127,7 +127,7 @@ function SecurityInvariant() {
|
||||
<>
|
||||
<div className="flex justify-between items-center border-b border-neutral-600 mb-4 p-4">
|
||||
<h2 className="text-2xl">{t(I18nKey.INVARIANT$LOG_LABEL)}</h2>
|
||||
<Button onClick={() => exportTraces()} className="bg-neutral-700">
|
||||
<Button onPress={() => exportTraces()} className="bg-neutral-700">
|
||||
{t(I18nKey.INVARIANT$EXPORT_TRACE_LABEL)}
|
||||
</Button>
|
||||
</div>
|
||||
@@ -162,7 +162,7 @@ function SecurityInvariant() {
|
||||
<h2 className="text-2xl">{t(I18nKey.INVARIANT$POLICY_LABEL)}</h2>
|
||||
<Button
|
||||
className="bg-neutral-700"
|
||||
onClick={() => updatePolicy({ policy })}
|
||||
onPress={() => updatePolicy({ policy })}
|
||||
>
|
||||
{t(I18nKey.INVARIANT$UPDATE_POLICY_LABEL)}
|
||||
</Button>
|
||||
@@ -184,7 +184,7 @@ function SecurityInvariant() {
|
||||
<h2 className="text-2xl">{t(I18nKey.INVARIANT$SETTINGS_LABEL)}</h2>
|
||||
<Button
|
||||
className="bg-neutral-700"
|
||||
onClick={() => updateRiskSeverity({ riskSeverity: selectedRisk })}
|
||||
onPress={() => updateRiskSeverity({ riskSeverity: selectedRisk })}
|
||||
>
|
||||
{t(I18nKey.INVARIANT$UPDATE_SETTINGS_LABEL)}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user