Refactor layout and home page for improved localization and session handling

- Updated RootLayout to include locale support and integrated ThemeProvider and LocaleProvider for better internationalization.
- Replaced static home page content with a redirect based on user session status, enhancing user experience by directing to the appropriate dashboard or login page.
- Switched font from Geist to Inter for improved typography consistency.
This commit is contained in:
smueller
2026-07-22 14:01:09 +02:00
parent 04e04eb11d
commit 84476e6277
30 changed files with 1073 additions and 128 deletions

View File

@@ -0,0 +1,29 @@
import { notFound } from 'next/navigation';
import type { ReactNode } from 'react';
import { DashboardShell } from '@/components/layout/dashboard-shell';
import { requireGuildAccessOrRedirect } from '@/lib/auth';
import { getManageableGuilds } from '@/lib/guilds';
interface GuildLayoutProps {
children: ReactNode;
params: Promise<{ guildId: string }>;
}
export default async function GuildLayout({ children, params }: GuildLayoutProps) {
const { guildId } = await params;
const session = await requireGuildAccessOrRedirect(guildId);
const guilds = await getManageableGuilds(session);
const currentGuild = guilds.find((guild) => guild.id === guildId);
if (!currentGuild) {
notFound();
}
const otherGuilds = guilds.filter((guild) => guild.id !== guildId);
return (
<DashboardShell guildId={guildId} currentGuild={currentGuild} otherGuilds={otherGuilds} user={session.user}>
{children}
</DashboardShell>
);
}