mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix: replace onClick with onPress in NextUI button components
This commit is contained in:
parent
7c8661ec0b
commit
4b7ab042f3
@ -31,7 +31,7 @@ const CollapseInput: React.FC<CollapseInputProps> = (props) => {
|
||||
<FaSearch title={title} />
|
||||
</div>
|
||||
}
|
||||
onClick={(e) => {
|
||||
onPress={(e) => {
|
||||
e.stopPropagation()
|
||||
inputRef.current?.focus()
|
||||
}}
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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)
|
||||
)
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user