refactor: minor adjustments

This commit is contained in:
kunish 2023-09-03 16:28:13 +08:00
parent 84c70b0550
commit 9ffd0cf362
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
3 changed files with 11 additions and 3 deletions

View File

@ -14,10 +14,10 @@ export const ForTwoColumns = (props: { subChild: JSX.Element[] }) => {
() => windowWidth() >= 640 && renderInTwoColumn(), () => windowWidth() >= 640 && renderInTwoColumn(),
) // 640 is sm size in daisyui ) // 640 is sm size in daisyui
const leftCloumns = createMemo(() => const leftCloumns = createMemo(() =>
props.subChild.filter((i, index) => index % 2 === 0 || !isShowTwoColumns()), props.subChild.filter((_, index) => index % 2 === 0 || !isShowTwoColumns()),
) )
const rightCloumns = createMemo(() => const rightCloumns = createMemo(() =>
props.subChild.filter((i, index) => index % 2 === 1), props.subChild.filter((_, index) => index % 2 === 1),
) )
return ( return (

View File

@ -41,16 +41,24 @@ export const sortProxiesByOrderingType = (
switch (orderingType) { switch (orderingType) {
case PROXIES_ORDERING_TYPE.LATENCY_ASC: case PROXIES_ORDERING_TYPE.LATENCY_ASC:
if (prevLatency === -1) return 1 if (prevLatency === -1) return 1
if (nextLatency === -1) return -1 if (nextLatency === -1) return -1
return prevLatency - nextLatency return prevLatency - nextLatency
case PROXIES_ORDERING_TYPE.LATENCY_DESC: case PROXIES_ORDERING_TYPE.LATENCY_DESC:
if (prevLatency === -1) return 1 if (prevLatency === -1) return 1
if (nextLatency === -1) return -1 if (nextLatency === -1) return -1
return nextLatency - prevLatency return nextLatency - prevLatency
case PROXIES_ORDERING_TYPE.NAME_ASC: case PROXIES_ORDERING_TYPE.NAME_ASC:
return a.localeCompare(b) return a.localeCompare(b)
case PROXIES_ORDERING_TYPE.NAME_DESC: case PROXIES_ORDERING_TYPE.NAME_DESC:
return b.localeCompare(a) return b.localeCompare(a)
default: default:
return 0 return 0
} }

View File

@ -13,7 +13,7 @@
:root, :root,
[data-theme='wireframe'], [data-theme='wireframe'],
[data-theme='cyberpunk'] { [data-theme='cyberpunk'] {
font-family: '-apple-system', 'Fira Sans', 'Twemoji Mozilla', system-ui, monospace; font-family: 'Fira Sans', 'Twemoji Mozilla', system-ui, monospace;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {