Files
blitzkit/src/app/layout.tsx
T

58 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-09-30 22:12:48 -05:00
'use client';
2023-10-01 11:35:44 -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';
2023-09-07 01:13:03 +00:00
import { ReactNode } from 'react';
import Navbar from '../components/Navbar';
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',
});
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';
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>
<title>Blitzkrieg</title>
<meta
name="description"
content="🎉 Tools for everything World of Tanks Blitz"
/>
</head>
2023-09-07 01:13:03 +00:00
<body
style={{
margin: 0,
2023-09-30 22:12:48 -05:00
background: isEmbed
? 'transparent'
: 'url(https://i.imgur.com/PhS06NJ.png)',
2023-09-07 01:13:03 +00:00
}}
>
2023-12-03 19:45:43 -06:00
<Theme
appearance="dark"
panelBackground="translucent"
radius="full"
suppressHydrationWarning
suppressContentEditableWarning
>
2023-09-30 22:30:52 -05:00
{!isEmbed && <Navbar />}
2023-10-01 11:35:44 -05:00
<Flex direction="column">{children}</Flex>
2023-09-30 22:30:52 -05:00
</Theme>
2023-09-07 01:13:03 +00:00
</body>
</html>
);
}