mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15:35 +08:00
fix: card click
This commit is contained in:
parent
275238f9b8
commit
25cbdad8bc
@ -2,7 +2,11 @@ import InfiniteScroll from 'solid-infinite-scroll'
|
||||
import { createMemo, createSignal } from 'solid-js'
|
||||
import ProxyNodeCard from './ProxyNodeCard'
|
||||
|
||||
export default (props: { proxies: string[]; now?: string }) => {
|
||||
export default (props: {
|
||||
proxies: string[]
|
||||
now?: string
|
||||
onClick?: (name: string) => void
|
||||
}) => {
|
||||
const [maxRender, setMaxRender] = createSignal(30)
|
||||
const proxies = createMemo(() => props.proxies.slice(0, maxRender()))
|
||||
|
||||
@ -13,7 +17,13 @@ export default (props: { proxies: string[]; now?: string }) => {
|
||||
next={() => setMaxRender(maxRender() + 30)}
|
||||
>
|
||||
{(proxy) => (
|
||||
<ProxyNodeCard proxyName={proxy} isSelected={props.now === proxy} />
|
||||
<ProxyNodeCard
|
||||
proxyName={proxy}
|
||||
isSelected={props.now === proxy}
|
||||
onClick={() => {
|
||||
props.onClick?.(proxy!)
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</InfiniteScroll>
|
||||
)
|
||||
|
@ -90,7 +90,13 @@ export default () => {
|
||||
)
|
||||
|
||||
const content = (
|
||||
<ProxyCardGroups proxies={proxy.all!} now={proxy.now} />
|
||||
<ProxyCardGroups
|
||||
proxies={proxy.all!}
|
||||
now={proxy.now}
|
||||
onClick={(name) => {
|
||||
setProxyGroupByProxyName(proxy, name)
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user