feat: integrate Jira configuration into Header and layout
- Added `JiraConfigProvider` to `layout.tsx` for server-side Jira configuration retrieval. - Updated `Header.tsx` to conditionally display a link to the Jira dashboard with the project key if Jira is configured. - Enhanced user experience by integrating Jira settings into the main application layout.
This commit is contained in:
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { ThemeProvider } from "@/contexts/ThemeContext";
|
||||
import { JiraConfigProvider } from "@/contexts/JiraConfigContext";
|
||||
import { userPreferencesService } from "@/services/user-preferences";
|
||||
|
||||
const geistSans = Geist({
|
||||
@@ -24,8 +25,11 @@ export default async function RootLayout({
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
// Récupérer uniquement le thème côté serveur pour le SSR (optimisé)
|
||||
const initialTheme = await userPreferencesService.getTheme();
|
||||
// Récupérer les données côté serveur pour le SSR
|
||||
const [initialTheme, jiraConfig] = await Promise.all([
|
||||
userPreferencesService.getTheme(),
|
||||
userPreferencesService.getJiraConfig()
|
||||
]);
|
||||
|
||||
return (
|
||||
<html lang="en" className={initialTheme}>
|
||||
@@ -33,7 +37,9 @@ export default async function RootLayout({
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
<ThemeProvider initialTheme={initialTheme}>
|
||||
{children}
|
||||
<JiraConfigProvider config={jiraConfig}>
|
||||
{children}
|
||||
</JiraConfigProvider>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user