mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: isolated footer
This commit is contained in:
1 parent
04e42c929c
commit
17f4435a30
2 files changed
+41
-35
No files matched your search
+3
-35
@@ -1,22 +1,13 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import {
|
import { AlertDialog, Button, Flex, ScrollArea, Theme } from '@radix-ui/themes';
|
||||||
AlertDialog,
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Code,
|
|
||||||
Flex,
|
|
||||||
ScrollArea,
|
|
||||||
Text,
|
|
||||||
Theme,
|
|
||||||
} from '@radix-ui/themes';
|
|
||||||
import '@radix-ui/themes/styles.css';
|
import '@radix-ui/themes/styles.css';
|
||||||
import { config } from 'dotenv';
|
import { config } from 'dotenv';
|
||||||
import { Roboto_Flex } from 'next/font/google';
|
import { Roboto_Flex } from 'next/font/google';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import { ReactNode, use, useEffect, useState } from 'react';
|
import { ReactNode, use, useEffect, useState } from 'react';
|
||||||
import packageJSON from '../../package.json';
|
|
||||||
import { Analytics } from '../components/Analytics';
|
import { Analytics } from '../components/Analytics';
|
||||||
|
import { Footer } from '../components/Footer';
|
||||||
import Navbar from '../components/Navbar';
|
import Navbar from '../components/Navbar';
|
||||||
import { gameDefinitions } from '../core/blitzkrieg/gameDefinitions';
|
import { gameDefinitions } from '../core/blitzkrieg/gameDefinitions';
|
||||||
import isDev from '../core/blitzkrieg/isDev';
|
import isDev from '../core/blitzkrieg/isDev';
|
||||||
@@ -119,30 +110,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
|
|||||||
{!isEmbed && !isFullScreen && (
|
{!isEmbed && !isFullScreen && (
|
||||||
<>
|
<>
|
||||||
<div style={{ flex: 1 }} />
|
<div style={{ flex: 1 }} />
|
||||||
|
<Footer />
|
||||||
<Theme radius="none">
|
|
||||||
<Card>
|
|
||||||
<Flex justify="center">
|
|
||||||
<Flex
|
|
||||||
justify="between"
|
|
||||||
style={{
|
|
||||||
flex: 1,
|
|
||||||
maxWidth: 800,
|
|
||||||
padding: '0 16px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Text color="gray" size="2">
|
|
||||||
Blitzkrieg <Code>{packageJSON.version}</Code> for
|
|
||||||
WoTB <Code>{awaitedGameDefinitions.version}</Code>
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text color="gray" size="2">
|
|
||||||
Free forever, for everyone.
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</Card>
|
|
||||||
</Theme>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import { Card, Code, Flex, Text, Theme } from '@radix-ui/themes';
|
||||||
|
import { use } from 'react';
|
||||||
|
import packageJSON from '../../package.json';
|
||||||
|
import { gameDefinitions } from '../core/blitzkrieg/gameDefinitions';
|
||||||
|
import { useWideFormat } from '../hooks/useWideFormat';
|
||||||
|
|
||||||
|
export function Footer() {
|
||||||
|
const wideFormat = useWideFormat();
|
||||||
|
const awaitedGameDefinitions = use(gameDefinitions);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Theme radius="none">
|
||||||
|
<Card>
|
||||||
|
<Flex justify="center">
|
||||||
|
<Flex
|
||||||
|
justify={wideFormat ? 'between' : 'center'}
|
||||||
|
style={{
|
||||||
|
flex: 1,
|
||||||
|
maxWidth: 800,
|
||||||
|
padding: '0 16px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text color="gray" size="2">
|
||||||
|
Blitzkrieg <Code>{packageJSON.version}</Code> for WoTB{' '}
|
||||||
|
<Code>{awaitedGameDefinitions.version}</Code>
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
{wideFormat && (
|
||||||
|
<Text color="gray" size="2">
|
||||||
|
Free forever, for everyone.
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
</Card>
|
||||||
|
</Theme>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user