diff --git a/src/lib/components/Contact.svelte b/src/lib/components/Contact.svelte index 96e009f..e456c58 100644 --- a/src/lib/components/Contact.svelte +++ b/src/lib/components/Contact.svelte @@ -3,16 +3,45 @@ import LinkElement from './LinkElement.svelte'; import { contactsById } from '$lib/contacts'; - const activeContacts = ['email', 'school', 'github', 'twitter', 'linkedin']; - const displayContacts = activeContacts - .map((id) => contactsById[id]) - .filter((c) => c !== undefined); + let { + variant = 'icon-only', + showLinks = true + }: { + variant?: 'icon-only' | 'labeled'; + showLinks?: boolean; + } = $props(); + + let activeContacts = $derived( + variant === 'icon-only' + ? ['email', 'school', 'github', 'twitter', 'linkedin'] + : ['home', 'email', 'github', 'twitter', 'linkedin', 'school'] + ); + + let displayContacts = $derived( + activeContacts.map((id) => contactsById[id]).filter((c) => c !== undefined) + ); -
+
{#each displayContacts as contact} - - - + {#if showLinks} + + + {#if variant === 'labeled'} + {contact.text} + {/if} + + {:else} + + + {#if variant === 'labeled'} + {contact.text} + {/if} + + {/if} {/each}
diff --git a/src/lib/components/cv/Contact.svelte b/src/lib/components/cv/Contact.svelte deleted file mode 100644 index eb3bf63..0000000 --- a/src/lib/components/cv/Contact.svelte +++ /dev/null @@ -1,21 +0,0 @@ - - -
- {#each displayContacts as contact} - - - {contact.text} - - {/each} -
diff --git a/src/routes/cv/+page.svelte b/src/routes/cv/+page.svelte index e00d4f2..114150b 100644 --- a/src/routes/cv/+page.svelte +++ b/src/routes/cv/+page.svelte @@ -1,7 +1,7 @@