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 { For } from 'solid-js'
|
||||||
import { createMemo, createSignal } from 'solid-js'
|
|
||||||
import { ProxyNodeCard } from '~/components'
|
import { ProxyNodeCard } from '~/components'
|
||||||
|
|
||||||
export const ProxyCardGroups = (props: {
|
export const ProxyCardGroups = (props: {
|
||||||
@ -7,15 +6,8 @@ export const ProxyCardGroups = (props: {
|
|||||||
now?: string
|
now?: string
|
||||||
onClick?: (name: string) => void
|
onClick?: (name: string) => void
|
||||||
}) => {
|
}) => {
|
||||||
const [maxRender, setMaxRender] = createSignal(100)
|
|
||||||
const proxyNames = createMemo(() => props.proxyNames.slice(0, maxRender()))
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InfiniteScroll
|
<For each={props.proxyNames}>
|
||||||
each={proxyNames()}
|
|
||||||
hasMore={proxyNames().length < props.proxyNames.length}
|
|
||||||
next={() => setMaxRender(maxRender() + 30)}
|
|
||||||
>
|
|
||||||
{(proxy) => (
|
{(proxy) => (
|
||||||
<ProxyNodeCard
|
<ProxyNodeCard
|
||||||
proxyName={proxy}
|
proxyName={proxy}
|
||||||
@ -23,6 +15,6 @@ export const ProxyCardGroups = (props: {
|
|||||||
onClick={props.onClick && (() => props.onClick?.(proxy))}
|
onClick={props.onClick && (() => props.onClick?.(proxy))}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</InfiniteScroll>
|
</For>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -224,13 +224,11 @@ export default () => {
|
|||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
||||||
const content = <ProxyCardGroups proxyNames={sortedProxyNames} />
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Collapse
|
<Collapse
|
||||||
isOpen={collapsedMap()[proxyProvider.name]}
|
isOpen={collapsedMap()[proxyProvider.name]}
|
||||||
title={title}
|
title={title}
|
||||||
content={content}
|
content={<ProxyCardGroups proxyNames={sortedProxyNames} />}
|
||||||
onCollapse={(val) => setCollapsedMap(proxyProvider.name, val)}
|
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 (
|
return (
|
||||||
<Collapse
|
<Collapse
|
||||||
isOpen={collapsedMap()[proxy.name]}
|
isOpen={collapsedMap()[proxy.name]}
|
||||||
title={title}
|
title={title}
|
||||||
content={content}
|
content={
|
||||||
|
<ProxyCardGroups
|
||||||
|
proxyNames={sortedProxyNames}
|
||||||
|
now={proxy.now}
|
||||||
|
onClick={(name) => {
|
||||||
|
void onProxyNodeClick(proxy, name)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onCollapse={(val) => setCollapsedMap(proxy.name, val)}
|
onCollapse={(val) => setCollapsedMap(proxy.name, val)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user