Guest User

Untitled

a guest
Nov 21st, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. Layout.tsx:
  2.  
  3. import type { Metadata } from "next";
  4. import { Plus_Jakarta_Sans } from "next/font/google";
  5. import "./globals.css";
  6. import { Toaster } from "@/components/ui/toaster";
  7.  
  8. const plusJakarta = Plus_Jakarta_Sans({
  9. subsets: ["latin"],
  10. variable: "--font-plus-jakarta",
  11. });
  12.  
  13. export const metadata: Metadata = {
  14. metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"),
  15. title: "DesignDir - Web Design Tools & Resources Directory",
  16. description:
  17. "Discover curated web design tools, design resources, and professional design tools directory. Your one-stop destination for all design needs.",
  18. keywords: [
  19. "design tools",
  20. "web design tools",
  21. "web design directory",
  22. "design resources",
  23. ],
  24. openGraph: {
  25. title: "DesignDir - Web Design Tools & Resources Directory",
  26. description:
  27. "Discover curated web design tools, design resources, and professional design tools directory.",
  28. type: "website",
  29. locale: "en_US",
  30. siteName: "DesignDir",
  31. },
  32. twitter: {
  33. card: "summary_large_image",
  34. title: "DesignDir - Web Design Tools & Resources Directory",
  35. description:
  36. "Discover curated web design tools, design resources, and professional design tools directory.",
  37. },
  38. icons: {
  39. icon: "/favicon.ico",
  40. apple: "/apple-touch-icon.png",
  41. },
  42. };
  43.  
  44. export default function RootLayout({
  45. children,
  46. }: {
  47. children: React.ReactNode;
  48. }) {
  49. return (
  50. <html lang="en" suppressHydrationWarning>
  51. <head>
  52. <script
  53. dangerouslySetInnerHTML={{
  54. __html: `
  55. try {
  56. const theme = localStorage.getItem('designdir.theme');
  57. if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
  58. document.documentElement.classList.add('dark');
  59. } else {
  60. document.documentElement.classList.remove('dark');
  61. }
  62. } catch (e) {}
  63. `,
  64. }}
  65. />
  66. </head>
  67. <body className={plusJakarta.className}>
  68. {children}
  69. <Toaster />
  70. </body>
  71. </html>
  72. );
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment