Skip to content

Commit

Permalink
refactor: minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Sep 3, 2023
1 parent 84c70b0 commit 9ffd0cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/ForTwoColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export const ForTwoColumns = (props: { subChild: JSX.Element[] }) => {
() => windowWidth() >= 640 && renderInTwoColumn(),
) // 640 is sm size in daisyui
const leftCloumns = createMemo(() =>
props.subChild.filter((i, index) => index % 2 === 0 || !isShowTwoColumns()),
props.subChild.filter((_, index) => index % 2 === 0 || !isShowTwoColumns()),
)
const rightCloumns = createMemo(() =>
props.subChild.filter((i, index) => index % 2 === 1),
props.subChild.filter((_, index) => index % 2 === 1),
)

return (
Expand Down
8 changes: 8 additions & 0 deletions src/helpers/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,24 @@ export const sortProxiesByOrderingType = (
switch (orderingType) {
case PROXIES_ORDERING_TYPE.LATENCY_ASC:
if (prevLatency === -1) return 1

if (nextLatency === -1) return -1

return prevLatency - nextLatency

case PROXIES_ORDERING_TYPE.LATENCY_DESC:
if (prevLatency === -1) return 1

if (nextLatency === -1) return -1

return nextLatency - prevLatency

case PROXIES_ORDERING_TYPE.NAME_ASC:
return a.localeCompare(b)

case PROXIES_ORDERING_TYPE.NAME_DESC:
return b.localeCompare(a)

default:
return 0
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:root,
[data-theme='wireframe'],
[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 {
Expand Down

0 comments on commit 9ffd0cf

Please sign in to comment.