From 1bb36a1bd618e41863baac694c2ff115d364dbd8 Mon Sep 17 00:00:00 2001 From: kunish Date: Wed, 6 Sep 2023 22:47:02 +0800 Subject: [PATCH] feat(proxy): keep tab at the top --- src/pages/Proxies.tsx | 282 +++++++++++++++++++++--------------------- 1 file changed, 143 insertions(+), 139 deletions(-) diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx index 289bc18..bd9409f 100644 --- a/src/pages/Proxies.tsx +++ b/src/pages/Proxies.tsx @@ -96,9 +96,9 @@ export default () => { ] return ( -
+
-
+
{(tab) => (
- - { - const sortedProxyNames = sortProxiesByOrderingType( - proxyProvider.proxies.map((i) => i.name) ?? [], - latencyMap(), - proxiesOrderingType(), - ) +
+ + { + const sortedProxyNames = sortProxiesByOrderingType( + proxyProvider.proxies.map((i) => i.name) ?? [], + latencyMap(), + proxiesOrderingType(), + ) - const title = ( - <> -
-
- {proxyProvider.name} -
- {proxyProvider.proxies.length} + const title = ( + <> +
+
+ {proxyProvider.name} +
+ {proxyProvider.proxies.length} +
+
+ +
+ + +
-
- + + +
+ {proxyProvider.vehicleType} :: {t('updated')}{' '} + {formatTimeFromNow(proxyProvider.updatedAt)} +
+ + + + + + ) + + const content = + + return ( + setCollapsedMap(proxyProvider.name, val)} + /> + ) + })} + /> + + + +
+ + + + { + const sortedProxyNames = sortProxiesByOrderingType( + proxy.all ?? [], + latencyMap(), + proxiesOrderingType(), + ) + + const title = ( + <> +
+
+ {proxy.name} +
{proxy.all?.length}
+
-
- - -
- {proxyProvider.vehicleType} :: {t('updated')}{' '} - {formatTimeFromNow(proxyProvider.updatedAt)} -
- - - - - - ) - - const content = - - return ( - setCollapsedMap(proxyProvider.name, val)} - /> - ) - })} - /> -
- - -
- - - - { - const sortedProxyNames = sortProxiesByOrderingType( - proxy.all ?? [], - latencyMap(), - proxiesOrderingType(), - ) - - const title = ( - <> -
-
- {proxy.name} -
{proxy.all?.length}
+
+ {proxy.type} {proxy.now?.length > 0 && ` :: ${proxy.now}`}
- -
+ + + ) -
- {proxy.type} {proxy.now?.length > 0 && ` :: ${proxy.now}`} -
+ const content = ( + { + void onProxyNodeClick(proxy, name) + }} + /> + ) - - - - - ) - - const content = ( - { - void onProxyNodeClick(proxy, name) - }} - /> - ) - - return ( - setCollapsedMap(proxy.name, val)} - /> - ) - })} - /> - + return ( + setCollapsedMap(proxy.name, val)} + /> + ) + })} + /> + +
) }