Files
blitzkit/src/app/layout.tsx
T

92 lines
2.3 KiB
TypeScript
Raw Normal View History

2023-09-30 22:12:48 -05:00
'use client';
2024-05-22 14:16:46 -05:00
import { Flex, Theme } from '@radix-ui/themes';
2023-09-30 22:30:52 -05:00
import '@radix-ui/themes/styles.css';
2023-09-18 23:05:19 +00:00
import { config } from 'dotenv';
2023-09-12 02:38:50 +00:00
import { Roboto_Flex } from 'next/font/google';
2023-09-30 22:12:48 -05:00
import { usePathname } from 'next/navigation';
2024-05-23 13:20:07 -05:00
import { ReactNode, Suspense } from 'react';
2024-05-23 13:17:45 -05:00
import { Footer } from '../components/Footer';
2024-05-23 13:20:07 -05:00
import { Loader } from '../components/Loader';
2024-05-14 14:07:44 -05:00
import Navbar, { NAVBAR_HEIGHT } from '../components/Navbar';
2024-04-21 10:21:52 -05:00
import { Party3 } from '../components/Party3';
2024-05-22 14:16:46 -05:00
import { Checks } from './components/Checks';
import './layout.css';
2023-09-07 01:13:03 +00:00
2023-09-18 23:05:19 +00:00
config();
2023-09-07 01:13:03 +00:00
interface RootLayoutProps {
children: ReactNode;
}
2023-09-12 02:38:50 +00:00
const robotoFlex = Roboto_Flex({
subsets: ['latin'],
display: 'swap',
2024-06-03 16:47:21 -05:00
variable: '--font-roboto-flex',
2023-09-12 02:38:50 +00:00
});
2023-09-07 01:13:03 +00:00
export default function RootLayout({ children }: RootLayoutProps) {
2023-09-30 22:12:48 -05:00
const pathname = usePathname();
const isEmbed = pathname.split('/')[1] === 'embeds';
2024-04-18 18:28:46 -05:00
const isRoot = pathname === '/';
2023-09-30 22:12:48 -05:00
2023-09-07 01:13:03 +00:00
return (
2023-09-12 02:38:50 +00:00
<html lang="en" className={robotoFlex.className}>
2023-10-01 17:26:08 -05:00
<head>
2024-04-18 19:11:50 -05:00
{isRoot && (
<>
2024-04-23 10:19:32 -05:00
<title>BlitzKit</title>
2024-04-18 19:11:50 -05:00
<meta
name="description"
content="🎉 Tools for everything World of Tanks Blitz"
/>
</>
)}
2024-04-23 10:19:32 -05:00
<meta property="og:site_name" content="BlitzKit" />
2024-04-16 13:49:33 -05:00
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
2024-04-08 21:43:47 -05:00
2024-04-21 10:21:52 -05:00
<Party3 />
2023-10-01 17:26:08 -05:00
</head>
2023-09-07 01:13:03 +00:00
<body
style={{
margin: 0,
2024-02-27 08:00:16 -06:00
backgroundColor: isEmbed ? 'transparent' : undefined,
2023-09-07 01:13:03 +00:00
}}
>
2023-12-03 19:45:43 -06:00
<Theme
2024-05-14 14:07:44 -05:00
appearance="dark"
2024-04-05 17:44:31 -05:00
panelBackground="solid"
2023-12-03 19:45:43 -06:00
radius="full"
2024-05-21 14:18:21 -05:00
accentColor="amber"
2023-12-03 19:45:43 -06:00
suppressHydrationWarning
suppressContentEditableWarning
>
2024-04-06 12:28:29 -05:00
<Flex
direction="column"
2024-05-14 14:07:44 -05:00
style={{
minHeight: '100vh',
paddingTop: isEmbed ? undefined : NAVBAR_HEIGHT,
}}
2024-04-06 12:28:29 -05:00
>
2024-04-06 12:22:56 -05:00
{!isEmbed && <Navbar />}
2024-05-14 14:07:44 -05:00
2024-05-22 14:16:46 -05:00
<Checks />
2024-02-24 19:34:02 -06:00
2024-05-23 13:20:07 -05:00
<Suspense
2024-04-18 19:11:50 -05:00
fallback={
<div style={{ flex: 1 }}>
<Loader />
</div>
}
>
{children}
2024-05-23 13:20:07 -05:00
</Suspense>
2024-02-27 09:31:22 -06:00
2024-05-23 13:17:45 -05:00
{!isEmbed && <Footer />}
2024-04-06 12:22:56 -05:00
</Flex>
2023-09-30 22:30:52 -05:00
</Theme>
2023-09-07 01:13:03 +00:00
</body>
</html>
);
}