mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
fix: failed to resolve import solid-infinite-scroll
This commit is contained in:
parent
f11386f339
commit
ebc95fe585
@ -1,5 +1,4 @@
|
||||
import InfiniteScroll from 'solid-infinite-scroll'
|
||||
import { createMemo, createSignal } from 'solid-js'
|
||||
import { For } from 'solid-js'
|
||||
import { ProxyNodeCard } from '~/components'
|
||||
|
||||
export const ProxyCardGroups = (props: {
|
||||
@ -7,15 +6,8 @@ export const ProxyCardGroups = (props: {
|
||||
now?: string
|
||||
onClick?: (name: string) => void
|
||||
}) => {
|
||||
const [maxRender, setMaxRender] = createSignal(100)
|
||||
const proxyNames = createMemo(() => props.proxyNames.slice(0, maxRender()))
|
||||
|
||||
return (
|
||||
<InfiniteScroll
|
||||
each={proxyNames()}
|
||||
hasMore={proxyNames().length < props.proxyNames.length}
|
||||
next={() => setMaxRender(maxRender() + 30)}
|
||||
>
|
||||
<For each={props.proxyNames}>
|
||||
{(proxy) => (
|
||||
<ProxyNodeCard
|
||||
proxyName={proxy}
|
||||
@ -23,6 +15,6 @@ export const ProxyCardGroups = (props: {
|
||||
onClick={props.onClick && (() => props.onClick?.(proxy))}
|
||||
/>
|
||||
)}
|
||||
</InfiniteScroll>
|
||||
</For>
|
||||
)
|
||||
}
|
||||
|
@ -224,13 +224,11 @@ export default () => {
|
||||
</>
|
||||
)
|
||||
|
||||
const content = <ProxyCardGroups proxyNames={sortedProxyNames} />
|
||||
|
||||
return (
|
||||
<Collapse
|
||||
isOpen={collapsedMap()[proxyProvider.name]}
|
||||
title={title}
|
||||
content={content}
|
||||
content={<ProxyCardGroups proxyNames={sortedProxyNames} />}
|
||||
onCollapse={(val) => setCollapsedMap(proxyProvider.name, val)}
|
||||
/>
|
||||
)
|
||||
@ -286,21 +284,19 @@ export default () => {
|
||||
</>
|
||||
)
|
||||
|
||||
const content = (
|
||||
<ProxyCardGroups
|
||||
proxyNames={sortedProxyNames}
|
||||
now={proxy.now}
|
||||
onClick={(name) => {
|
||||
void onProxyNodeClick(proxy, name)
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
return (
|
||||
<Collapse
|
||||
isOpen={collapsedMap()[proxy.name]}
|
||||
title={title}
|
||||
content={content}
|
||||
content={
|
||||
<ProxyCardGroups
|
||||
proxyNames={sortedProxyNames}
|
||||
now={proxy.now}
|
||||
onClick={(name) => {
|
||||
void onProxyNodeClick(proxy, name)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
onCollapse={(val) => setCollapsedMap(proxy.name, val)}
|
||||
/>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user