diff --git a/bun.lockb b/bun.lockb
index bd805e6..179aaa8 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 3f3d964..86d2a54 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"@fontsource/source-code-pro": "^5.0.16",
"@fontsource/source-sans-pro": "^5.0.8",
"@fontsource/space-mono": "^5.0.20",
+ "@phosphor-icons/core": "^2.1.1",
"@preact/signals": "^1.3.0",
"@types/jsdom": "^21.1.7",
"astro": "^4.15.11",
diff --git a/src/client/ComboBox.tsx b/src/client/ComboBox.tsx
index be2b008..cc62c8f 100644
--- a/src/client/ComboBox.tsx
+++ b/src/client/ComboBox.tsx
@@ -1,6 +1,7 @@
import { type ComponentChildren } from 'preact'
import { useState, useRef, useEffect } from 'preact/hooks'
import { clsx, isMobile } from './lib/util'
+import { PhosphorIcon } from './Icon'
export const ComboBox = ({
value,
@@ -40,7 +41,8 @@ export const ComboBox = ({
>
setOpen(!open)}>
{children[value]}
-
expand_more
+ {/*
expand_more */}
+
{open && (
(`node_modules/@phosphor-icons/core/assets/light/*.svg`, {
+ eager: true,
+ })
+ ).map(([path, module]) => [path.split('/').pop()!.split('.')[0].replace('-light', ''), module])
+)
+
+type Props = {
+ name: string
+}
+
+export const PhosphorIcon = ({ name }: Props) => {
+ const icon = icons[name]
+
+ if (!icon) {
+ throw new Error(`Icon "${name}" not found`)
+ }
+
+ return

+}
diff --git a/src/client/UtentiPage.tsx b/src/client/UtentiPage.tsx
index 8a71db9..d687b44 100644
--- a/src/client/UtentiPage.tsx
+++ b/src/client/UtentiPage.tsx
@@ -3,6 +3,7 @@ import Fuse from 'fuse.js'
import { useEffect } from 'preact/hooks'
import { ShowMore } from './Paginate'
import { ComboBox } from './ComboBox'
+import { PhosphorIcon } from './Icon'
type User = {
uid: string
@@ -11,15 +12,15 @@ type User = {
const FILTERS = {
utenti: {
- icon: 'person',
+ icon: 'user',
label: 'Utenti',
},
macchinisti: {
- icon: 'construction',
+ icon: 'wrench',
label: 'Macchinisti',
},
rappstud: {
- icon: 'account_balance',
+ icon: 'bank',
label: 'Rappresentanti',
},
}
@@ -105,7 +106,9 @@ export const UtentiPage = () => {
Object.entries(FILTERS).map(([k, v]) => [
k,
<>
-
{v.icon} {v.label}
+ {/*
{v.icon} {v.label} */}
+
+ {v.label}
>,
])
)}
@@ -117,7 +120,8 @@ export const UtentiPage = () => {
onInput={e => ($searchText.value = e.currentTarget.value)}
value={$searchText.value}
/>
-
search
+ {/*
search */}
+
@@ -126,13 +130,22 @@ export const UtentiPage = () => {
{poissonUser => (
-
+ {/*
{RAPPSTUD.includes(poissonUser.uid)
? 'account_balance'
: MACCHINISTI.includes(poissonUser.uid)
? 'construction'
: 'person'}
-
+ */}
+
{poissonUser.gecos}
@@ -140,7 +153,8 @@ export const UtentiPage = () => {
href={`https://poisson.phc.dm.unipi.it/~${poissonUser.uid}`}
target="_blank"
>
-
open_in_new
+ {/*
open_in_new */}
+
diff --git a/src/components/Bubble.astro b/src/components/Bubble.astro
index 625c2bc..bf62b95 100644
--- a/src/components/Bubble.astro
+++ b/src/components/Bubble.astro
@@ -1,14 +1,11 @@
---
-import iconGithub from 'lucide-static/icons/github.svg'
-import iconLinkedin from 'lucide-static/icons/linkedin.svg'
-import iconGlobe from 'lucide-static/icons/globe.svg'
-import iconMail from 'lucide-static/icons/mail.svg'
+import PhosphorIcon from './PhosphorIcon.astro'
-const ICONS_MAP = {
- github: iconGithub,
- linkedin: iconLinkedin,
- website: iconGlobe,
- mail: iconMail,
+const ICONS_MAP: Record
= {
+ github: 'github-logo',
+ linkedin: 'linkedin-logo',
+ website: 'globe',
+ mail: 'mailbox',
}
type Props = {
@@ -38,8 +35,7 @@ const { image, fullName, entranceDate, exitDate, description, social } = Astro.p
diff --git a/src/components/PhosphorIcon.astro b/src/components/PhosphorIcon.astro
new file mode 100644
index 0000000..9c5fb65
--- /dev/null
+++ b/src/components/PhosphorIcon.astro
@@ -0,0 +1,21 @@
+---
+import { Image } from 'astro:assets'
+
+type Props = {
+ name: string
+}
+
+const { name } = Astro.props
+
+const icons = Object.fromEntries(
+ Object.entries(
+ import.meta.glob<{ default: ImageMetadata }>(`node_modules/@phosphor-icons/core/assets/light/*.svg`)
+ ).map(([path, module]) => [path.split('/').pop()!.split('.')[0].replace('-light', ''), module])
+)
+
+if (!icons[name]) {
+ throw new Error(`Icon "${name}" not found`)
+}
+---
+
+
diff --git a/src/data/macchinisti.yaml b/src/data/macchinisti.yaml
index 40154b6..ac25045 100644
--- a/src/data/macchinisti.yaml
+++ b/src/data/macchinisti.yaml
@@ -1,3 +1,5 @@
+# the schema of this file in "@/files.d.ts"
+
- fullName: Antonio De Lucreziis
entranceDate: 2019
description: |
diff --git a/src/pages/macchinisti.astro b/src/pages/macchinisti.astro
index 7d6eb9d..27fa7c3 100644
--- a/src/pages/macchinisti.astro
+++ b/src/pages/macchinisti.astro
@@ -8,27 +8,21 @@ import macchinisti from '@/data/macchinisti.yaml'
macchinisti.sort((a, b) => b.entranceDate - a.entranceDate)
// Import all images from assets folder
-const images: Record = Object.fromEntries(
- await Promise.all(
- Object.entries(import.meta.glob('@/assets/macchinisti/*')).map(async ([path, module]) => [
- path.split('/').pop()!.split('.')[0],
- // @ts-ignore
- (await module()).default,
- ])
- )
+const images = Object.fromEntries(
+ Object.entries(
+ import.meta.glob<{ default: ImageMetadata }>('@/assets/macchinisti/*', {
+ eager: true,
+ })
+ ).map(([path, module]) => [path.split('/').pop()!.split('.')[0], module])
)
-console.log(macchinisti)
-console.log(images)
-
const currentMacchinisti = macchinisti.filter(macchinista => !macchinista.exitDate)
const pastMacchinisti = macchinisti.filter(macchinista => macchinista.exitDate)
-const getMacchinistaPicture = (fullName: string): ImageMetadata => {
+const getMacchinistaPicture = (fullName: string) => {
const macchinistaId = fullName.toLowerCase().replace(/\s+/g, '-')
- console.log(macchinistaId)
-
- return images[macchinistaId] ?? images['fallback']
+ const { default: image } = images[macchinistaId] ?? images['fallback']
+ return image
}
---
diff --git a/src/styles/components.scss b/src/styles/components.scss
index fbcfc5f..3e6dc89 100644
--- a/src/styles/components.scss
+++ b/src/styles/components.scss
@@ -8,6 +8,16 @@
// Components - for complex parts of the UI like search bars or compound buttons
//
+ .phosphor-icon {
+ box-sizing: content-box;
+
+ width: 22px;
+ height: 22px;
+
+ display: grid;
+ place-content: center;
+ }
+
.material-symbols-outlined {
font-family: 'Material Symbols Outlined Variable';
font-weight: normal;
@@ -63,7 +73,8 @@
padding-left: 0.35rem;
}
- .material-symbols-outlined {
+ .material-symbols-outlined,
+ .phosphor-icon {
padding: 0 0.5rem;
}
}
@@ -699,7 +710,8 @@
background: var(--filter-bg-color, #ddd);
- .material-symbols-outlined {
+ .material-symbols-outlined,
+ .phosphor-icon {
padding: 0 0.35rem;
}
@@ -834,7 +846,7 @@
text-align: center;
justify-items: center;
align-content: start;
- width: 25ch;
+ width: 28ch;
.date {
display: grid;
@@ -851,6 +863,11 @@
grid-auto-flow: column;
gap: 0.5rem;
justify-content: center;
+
+ .phosphor-icon {
+ width: 28px;
+ height: 28px;
+ }
}
> img {
diff --git a/src/styles/pages.scss b/src/styles/pages.scss
index 22955b3..4494b69 100644
--- a/src/styles/pages.scss
+++ b/src/styles/pages.scss
@@ -647,7 +647,7 @@
align-items: center;
padding: 6rem;
- gap: 4rem;
+ gap: 6rem;
}
}