Enhance user routing and layout management. Added support for user-specific routes, including dynamic user ID handling and updated component imports. Improved type definitions and user data mapping in hooks for better user experience.
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import { sites, siteSlugs } from '$lib/sites';
|
||||
import { sites, siteSlugs, type SiteSlug } from '$lib/sites';
|
||||
|
||||
let { data: _data }: { data: Record<string, unknown> } = $props();
|
||||
// `_data` is accepted to mirror Stackq's pattern (unused for now).
|
||||
let { data }: { data: App.PageData } = $props();
|
||||
|
||||
const visibleSlugs = $derived(
|
||||
data.user
|
||||
? (siteSlugs.filter((slug) => data.user && data.user[slug] === true) as SiteSlug[])
|
||||
: []
|
||||
);
|
||||
</script>
|
||||
|
||||
<main class="flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-4 sm:gap-6 sm:p-6">
|
||||
<h1 class="w-full max-w-xs shrink-0 text-center text-2xl font-semibold">Base</h1>
|
||||
<div class="flex w-full max-w-xs shrink-0 flex-col gap-3">
|
||||
{#each siteSlugs as slug}
|
||||
{#each visibleSlugs as slug}
|
||||
{@const site = sites[slug]}
|
||||
<a href="/{slug}" class="block">
|
||||
<Button class="h-16 min-h-16 w-full" variant="outline">
|
||||
|
||||
Reference in New Issue
Block a user