chore: removed icons CDN and other tweaks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createContext, type ComponentChildren, type JSX } from 'preact'
|
||||
import { type ComponentChildren } from 'preact'
|
||||
import { useState, useRef, useEffect } from 'preact/hooks'
|
||||
import { clsx } from './lib/util'
|
||||
|
||||
export const ComboBox = ({
|
||||
value,
|
||||
@@ -39,7 +40,7 @@ export const ComboBox = ({
|
||||
</div>
|
||||
{open && (
|
||||
<div
|
||||
class={cloak ? 'dropdown invisible' : 'dropdown'}
|
||||
class={clsx('dropdown', cloak && 'invisible')}
|
||||
ref={el => el && setItemWidth(el.offsetWidth)}
|
||||
>
|
||||
{Object.keys(children).map(key => (
|
||||
|
||||
@@ -122,7 +122,7 @@ export const UtentiPage = () => {
|
||||
</div>
|
||||
<div class="search-results">
|
||||
{$searchResults.value ? (
|
||||
<ShowMore items={$searchResults} pageSize={10}>
|
||||
<ShowMore items={$searchResults} pageSize={100}>
|
||||
{poissonUser => (
|
||||
<div class="search-result">
|
||||
<div class="icon">
|
||||
|
||||
@@ -32,3 +32,23 @@ export const trottleDebounce = <T extends any[], R>(
|
||||
return lastResult
|
||||
}
|
||||
}
|
||||
|
||||
type ClassValue = string | ClassValue[] | Record<string, boolean> | false | undefined
|
||||
|
||||
export function clsx(...args: ClassValue[]): string {
|
||||
return args
|
||||
.flatMap(arg => {
|
||||
if (typeof arg === 'string') {
|
||||
return arg
|
||||
} else if (Array.isArray(arg)) {
|
||||
return clsx(...arg)
|
||||
} else if (typeof arg === 'boolean') {
|
||||
return []
|
||||
} else if (typeof arg === 'object') {
|
||||
return Object.entries(arg).flatMap(([key, value]) => (value ? key : []))
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
})
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user