From ebc95fe58592a6f187f733ea1da3b56d738a7406 Mon Sep 17 00:00:00 2001 From: kunish Date: Sat, 16 Sep 2023 00:24:45 +0800 Subject: [PATCH] fix: failed to resolve import solid-infinite-scroll --- src/components/ProxyCardGroups.tsx | 14 +++----------- src/pages/Proxies.tsx | 24 ++++++++++-------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/components/ProxyCardGroups.tsx b/src/components/ProxyCardGroups.tsx index a1e8dd8..371de6d 100644 --- a/src/components/ProxyCardGroups.tsx +++ b/src/components/ProxyCardGroups.tsx @@ -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 ( - setMaxRender(maxRender() + 30)} - > + {(proxy) => ( props.onClick?.(proxy))} /> )} - + ) } diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx index d380d62..b36303f 100644 --- a/src/pages/Proxies.tsx +++ b/src/pages/Proxies.tsx @@ -224,13 +224,11 @@ export default () => { ) - const content = - return ( } onCollapse={(val) => setCollapsedMap(proxyProvider.name, val)} /> ) @@ -286,21 +284,19 @@ export default () => { ) - const content = ( - { - void onProxyNodeClick(proxy, name) - }} - /> - ) - return ( { + void onProxyNodeClick(proxy, name) + }} + /> + } onCollapse={(val) => setCollapsedMap(proxy.name, val)} /> )