|
1 | 1 | <script lang="ts"> |
2 | 2 | import type { Member } from '@a11y.cool/data'; |
3 | 3 | import { Globe, LinkedinLogo } from 'phosphor-svelte'; |
| 4 | + import { buildImageUrl } from '@a11y.cool/utils'; |
4 | 5 |
|
5 | 6 | let { member }: { member: Member } = $props(); |
| 7 | +
|
| 8 | + // Get API URL from environment |
| 9 | + const apiUrl = import.meta.env.VITE_API_URL; |
| 10 | +
|
| 11 | + // Build image URL with format detection |
| 12 | + const imageUrl = $derived(member.image ? buildImageUrl(member.image.id, apiUrl) : null); |
6 | 13 | </script> |
7 | 14 |
|
8 | 15 | <article |
9 | | - class="rounded-3xl shadow-card border border-border-input bg-background-alt p-6 flex flex-col items-start gap-4 min-h-[320px]" |
| 16 | + class="rounded-3xl shadow-card border border-border-input bg-background-alt p-6 flex flex-col items-start gap-4 h-full" |
10 | 17 | > |
11 | 18 | <!-- Circular member image --> |
12 | 19 | {#if member.image} |
13 | 20 | <div |
14 | 21 | class="w-24 h-24 rounded-full overflow-hidden border-2 border-border-input mb-2 self-center" |
15 | 22 | > |
16 | 23 | <img |
17 | | - src={member.image.id} |
| 24 | + src={imageUrl} |
18 | 25 | alt={member.image.description || `${member.name} profile picture`} |
19 | 26 | class="w-full h-full object-cover" |
20 | 27 | /> |
|
39 | 46 | </p> |
40 | 47 |
|
41 | 48 | <!-- URL links at the bottom --> |
42 | | - <div class="flex gap-4 mt-auto"> |
| 49 | + <div class="flex gap-4 mt-auto pt-4"> |
43 | 50 | {#if member.website} |
44 | 51 | <a |
45 | 52 | href={member.website} |
|
48 | 55 | class="flex items-center gap-2 px-3 py-2 rounded-lg bg-background border border-border-input hover:bg-muted transition-colors" |
49 | 56 | aria-label="Visit {member.name}'s website" |
50 | 57 | > |
51 | | - <Globe size={16} /> |
| 58 | + <Globe size={16} aria-hidden="true" /> |
52 | 59 | <span class="text-sm">Website</span> |
53 | 60 | </a> |
54 | 61 | {/if} |
|
61 | 68 | class="flex items-center gap-2 px-3 py-2 rounded-lg bg-background border border-border-input hover:bg-muted transition-colors" |
62 | 69 | aria-label="Visit {member.name}'s LinkedIn profile" |
63 | 70 | > |
64 | | - <LinkedinLogo size={16} /> |
| 71 | + <LinkedinLogo size={16} aria-hidden="true" /> |
65 | 72 | <span class="text-sm">LinkedIn</span> |
66 | 73 | </a> |
67 | 74 | {/if} |
|
0 commit comments