fix: replace onClick with onPress in NextUI button components

This commit is contained in:
pompurin404 2025-02-03 08:40:30 +08:00
parent 7c8661ec0b
commit 4b7ab042f3
8 changed files with 13 additions and 13 deletions

View File

@ -31,7 +31,7 @@ const CollapseInput: React.FC<CollapseInputProps> = (props) => {
<FaSearch title={title} />
</div>
}
onClick={(e) => {
onPress={(e) => {
e.stopPropagation()
inputRef.current?.focus()
}}

View File

@ -263,7 +263,7 @@ const MihomoConfig: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() => setPauseSSIDInput(pauseSSIDInput.filter((_, i) => i !== index))}
onPress={() => setPauseSSIDInput(pauseSSIDInput.filter((_, i) => i !== index))}
>
<MdDeleteForever className="text-lg" />
</Button>

View File

@ -52,7 +52,7 @@ const WebdavRestoreModal: React.FC<Props> = (props) => {
color="warning"
variant="flat"
className="ml-2"
onClick={async () => {
onPress={async () => {
try {
await webdavDelete(filename)
setFilenames(filenames.filter((name) => name !== filename))

View File

@ -95,7 +95,7 @@ const DNS: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() => handleListChange(type, '', index)}
onPress={() => handleListChange(type, '', index)}
>
<MdDeleteForever className="text-lg" />
</Button>
@ -294,7 +294,7 @@ const DNS: React.FC = () => {
color="warning"
variant="flat"
className="ml-2"
onClick={() => handleSubkeyChange('nameserverPolicy', '', '', index)}
onPress={() => handleSubkeyChange('nameserverPolicy', '', '', index)}
>
<MdDeleteForever className="text-lg" />
</Button>
@ -360,7 +360,7 @@ const DNS: React.FC = () => {
color="warning"
variant="flat"
className="ml-2"
onClick={() => handleSubkeyChange('hosts', '', '', index)}
onPress={() => handleSubkeyChange('hosts', '', '', index)}
>
<MdDeleteForever className="text-lg" />
</Button>

View File

@ -405,7 +405,7 @@ const Mihomo: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() =>
onPress={() =>
setLanAllowedIpsInput(lanAllowedIpsInput.filter((_, i) => i !== index))
}
>
@ -455,7 +455,7 @@ const Mihomo: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() =>
onPress={() =>
setLanDisallowedIpsInput(
lanDisallowedIpsInput.filter((_, i) => i !== index)
)
@ -533,7 +533,7 @@ const Mihomo: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() =>
onPress={() =>
setAuthenticationInput(authenticationInput.filter((_, i) => i !== index))
}
>
@ -585,7 +585,7 @@ const Mihomo: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() =>
onPress={() =>
setSkipAuthPrefixesInput(
skipAuthPrefixesInput.filter((_, i) => i !== index)
)

View File

@ -107,7 +107,7 @@ const Sniffer: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() => handleListChange(type, '', index)}
onPress={() => handleListChange(type, '', index)}
>
<MdDeleteForever className="text-lg" />
</Button>

View File

@ -195,7 +195,7 @@ const Sysproxy: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() => handleBypassChange('', index)}
onPress={() => handleBypassChange('', index)}
>
<MdDeleteForever className="text-lg" />
</Button>

View File

@ -274,7 +274,7 @@ const Tun: React.FC = () => {
size="sm"
variant="flat"
color="warning"
onClick={() => handleExcludeAddressChange('', index)}
onPress={() => handleExcludeAddressChange('', index)}
>
<MdDeleteForever className="text-lg" />
</Button>