Files
classroomio/apps/dashboard/src/lib/components/Navigation/CustomLinks.svelte
T
Nwosu EmmanuelandRotimi Best 27ee51155e feat: add custom navigation link to org landing page (#569)
* feat: custom navbar UI complete

* chore: added translations

* fear: attending to reviews

* add orgname to org landing page

---------

Co-authored-by: Rotimi Best <[email protected]>
2025-10-09 01:13:06 +01:00

32 lines
1.0 KiB
Svelte

<script lang="ts">
import type { TCustomLinks } from './types';
export let customLinks: TCustomLinks | undefined = undefined;
export let isMobile = false;
export let onMobileClick: (() => void) | undefined = undefined;
function handleLinkClick() {
if (onMobileClick) onMobileClick();
}
</script>
{#if customLinks}
<div class={isMobile ? 'space-y-4' : 'mr-4 hidden items-center space-x-6 lg:flex'}>
{#each customLinks.links as link}
<li>
<a
href={link.url}
target={link.openInNewTab ? '_blank' : '_self'}
rel={link.openInNewTab ? 'noopener noreferrer' : ''}
class={isMobile
? 'hover:text-primary-600 block rounded-md px-3 py-2 font-medium text-gray-700 transition-colors duration-200 hover:bg-gray-50'
: 'hover:text-primary-600 rounded-md px-4 py-2 font-medium text-gray-700 no-underline transition-all duration-200 ease-in-out hover:bg-gray-100'}
on:click={handleLinkClick}
>
{link.label}
</a>
</li>
{/each}
</div>
{/if}