cmd: updated prettier config and reformatted content
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -34,21 +34,14 @@ export const ComboBox = ({
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div
|
||||
class="combobox"
|
||||
ref={comboRef}
|
||||
style={{ width: isMobile() ? undefined : itemWidth + 48 + 'px' }}
|
||||
>
|
||||
<div class="combobox" ref={comboRef} style={{ width: isMobile() ? undefined : itemWidth + 48 + 'px' }}>
|
||||
<div class="selected" onClick={() => setOpen(!open)}>
|
||||
<div class="content">{children[value]}</div>
|
||||
{/* <span class="material-symbols-outlined">expand_more</span> */}
|
||||
<PhosphorIcon name="caret-down" />
|
||||
</div>
|
||||
{open && (
|
||||
<div
|
||||
class={clsx('dropdown', cloak && 'invisible')}
|
||||
ref={el => el && setItemWidth(el.offsetWidth)}
|
||||
>
|
||||
<div class={clsx('dropdown', cloak && 'invisible')} ref={el => el && setItemWidth(el.offsetWidth)}>
|
||||
{Object.keys(children).map(key => (
|
||||
<div
|
||||
class="option"
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ const icons = Object.fromEntries(
|
||||
Object.entries(
|
||||
import.meta.glob<{ default: ImageMetadata }>(`node_modules/@phosphor-icons/core/assets/light/*.svg`, {
|
||||
eager: true,
|
||||
})
|
||||
).map(([path, module]) => [path.split('/').pop()!.split('.')[0].replace('-light', ''), module])
|
||||
}),
|
||||
).map(([path, module]) => [path.split('/').pop()!.split('.')[0].replace('-light', ''), module]),
|
||||
)
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -68,22 +68,22 @@ export const UtentiPage = () => {
|
||||
$filter.value === 'macchinisti'
|
||||
? $utentiData.value.filter(user => MACCHINISTI.includes(user.uid))
|
||||
: $filter.value === 'rappstud'
|
||||
? $utentiData.value.filter(user => RAPPSTUD.includes(user.uid))
|
||||
: $utentiData.value
|
||||
? $utentiData.value.filter(user => RAPPSTUD.includes(user.uid))
|
||||
: $utentiData.value,
|
||||
)
|
||||
|
||||
const $fuse = useComputed(
|
||||
() =>
|
||||
new Fuse($filteredData.value, {
|
||||
keys: ['gecos', 'uid'],
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
||||
const $searchText = useSignal('')
|
||||
const $searchResults = useComputed(() =>
|
||||
$searchText.value.trim().length > 0
|
||||
? $fuse.value?.search($searchText.value).map(result => result.item) ?? []
|
||||
: $filteredData.value
|
||||
? ($fuse.value?.search($searchText.value).map(result => result.item) ?? [])
|
||||
: $filteredData.value,
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -110,7 +110,7 @@ export const UtentiPage = () => {
|
||||
<PhosphorIcon name={v.icon} />
|
||||
{v.label}
|
||||
</>,
|
||||
])
|
||||
]),
|
||||
)}
|
||||
</ComboBox>
|
||||
<div class="search">
|
||||
@@ -142,17 +142,14 @@ export const UtentiPage = () => {
|
||||
RAPPSTUD.includes(poissonUser.uid)
|
||||
? 'bank'
|
||||
: MACCHINISTI.includes(poissonUser.uid)
|
||||
? 'wrench'
|
||||
: 'user'
|
||||
? 'wrench'
|
||||
: 'user'
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div class="text">{poissonUser.gecos}</div>
|
||||
<div class="right">
|
||||
<a
|
||||
href={`https://poisson.phc.dm.unipi.it/~${poissonUser.uid}`}
|
||||
target="_blank"
|
||||
>
|
||||
<a href={`https://poisson.phc.dm.unipi.it/~${poissonUser.uid}`} target="_blank">
|
||||
{/* <span class="material-symbols-outlined">open_in_new</span> */}
|
||||
<PhosphorIcon name="arrow-square-out" />
|
||||
</a>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useEffect, useState } from 'preact/hooks'
|
||||
export const trottleDebounce = <T extends any[], R>(
|
||||
fn: (...args: T) => R,
|
||||
delay: number,
|
||||
options: { leading?: boolean; trailing?: boolean } = {}
|
||||
options: { leading?: boolean; trailing?: boolean } = {},
|
||||
): ((...args: T) => R | undefined) => {
|
||||
let lastCall = 0
|
||||
let lastResult: R | undefined
|
||||
|
||||
Reference in New Issue
Block a user