diff --git a/public/assets/banners/player.png b/public/assets/banners/profile.png similarity index 100% rename from public/assets/banners/player.png rename to public/assets/banners/profile.png diff --git a/public/assets/banners/session.png b/public/assets/banners/session.png new file mode 100644 index 000000000..5ab04b31d Binary files /dev/null and b/public/assets/banners/session.png differ diff --git a/public/assets/banners/tank.png b/public/assets/banners/tankopedia.png similarity index 100% rename from public/assets/banners/tank.png rename to public/assets/banners/tankopedia.png diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4429d43a2..5e35b9f7e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -28,9 +28,7 @@ export default function RootLayout({ children }: RootLayoutProps) { width: '100%', }} > -
- {children} -
+ {children} diff --git a/src/app/page.css.ts b/src/app/page.css.ts index 9cd53fcbe..7a3aa03e9 100644 --- a/src/app/page.css.ts +++ b/src/app/page.css.ts @@ -16,10 +16,10 @@ export const tool = style({ justifyContent: 'flex-end', padding: 16, gap: 4, - boxShadow: 'inset 0 -192px 128px -128px black', + boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`, transition: `box-shadow ${theme.durations.regular}`, ':hover': { - boxShadow: 'inset 0 -128px 128px -128px black', + boxShadow: `inset 0 -128px 128px -128px ${theme.colors.appBackground1}`, }, }); diff --git a/src/app/page.tsx b/src/app/page.tsx index f74aec4df..2ec4814ba 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -4,106 +4,112 @@ import { CaretRightIcon } from '@radix-ui/react-icons'; import Link from 'next/link'; import { useRef } from 'react'; import { Search, SearchItem } from 'react-fuzzysort'; +import PageWrapper from '../components/PageWrapper'; import { SearchBar } from '../components/SearchBar'; import { theme } from '../stitches.config'; import * as styles from './page.css'; -const TOOLS = [ +export const TOOLS = [ { + id: 'session', + title: 'Session tracker', + description: 'Track your performance in a session', + }, + { + id: 'ratings', title: 'Ratings', description: 'Current and old season leader boards', - banner: '/assets/banners/ratings.png', - href: '/tools/ratings', }, { + id: 'tankopedia', title: 'Tankopedia', description: 'Full Blitz tank encyclopedia', - banner: '/assets/banners/tank.png', - href: '/tools/tankopedia', }, { + id: 'inactive', title: 'Inactivity tracker', description: 'Find inactive members of a clan', - banner: '/assets/banners/inactive.png', - href: '/tools/inactive', }, { + id: 'profile', title: 'Player profile', description: "A player's basic non-statistical info", - banner: '/assets/banners/player.png', - href: '/tools/profile', - }, - { - title: 'More coming soon', - description: 'New tools are added often', - banner: '/assets/banners/more.png', - href: 'https://discord.gg/nDt7AjGJQH', }, + // { + // title: 'More coming soon', + // description: 'New tools are added often', + // banner: '/assets/banners/more.png', + // id: 'https://discord.gg/nDt7AjGJQH', + // }, ]; export default function Page() { const input = useRef(null); return ( -
- - +
- - ({ - node: ( - - + +
+ + ({ + node: ( + - {tool.title} - - - - {tool.description} - - - ), - query: `${tool.title} ${tool.description}`, - }) satisfies SearchItem, - )} - /> + + {tool.title} + + + + {tool.description} + + + ), + query: `${tool.title} ${tool.description}`, + }) satisfies SearchItem, + )} + /> +
-
+ ); } diff --git a/src/app/tools/layout.tsx b/src/app/tools/layout.tsx new file mode 100644 index 000000000..cf765f066 --- /dev/null +++ b/src/app/tools/layout.tsx @@ -0,0 +1,52 @@ +'use client'; + +import { ReactNode } from 'react'; +import { theme } from '../../stitches.config'; +import { TOOLS } from '../page'; + +interface ToolsLayoutProps { + children: ReactNode; +} + +export default function ToolsLayout({ children }: ToolsLayoutProps) { + const toolId = location.pathname.split('/').at(-1); + const tool = TOOLS.find((tool) => tool.id === toolId); + + return ( + <> +
+ + {tool?.title} + + + {tool?.description} + +
+ + {children} + + ); +} diff --git a/src/app/tools/session/page.tsx b/src/app/tools/session/page.tsx new file mode 100644 index 000000000..f4af4b146 --- /dev/null +++ b/src/app/tools/session/page.tsx @@ -0,0 +1,3 @@ +export default function Page() { + return 'inner'; +} diff --git a/src/components/PageWrapper.tsx b/src/components/PageWrapper.tsx new file mode 100644 index 000000000..ab33ed3d5 --- /dev/null +++ b/src/components/PageWrapper.tsx @@ -0,0 +1,13 @@ +import { ReactNode } from 'react'; + +interface PageWrapperProps { + children: ReactNode; +} + +export default function PageWrapper({ children }: PageWrapperProps) { + return ( +
+ {children} +
+ ); +} diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index ce89f298f..270136bd2 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -13,7 +13,7 @@ export const SearchBar = forwardRef>( style={{ display: 'flex', padding: 8, - borderRadius: 16, + borderRadius: 4, border: theme.borderStyles.interactive, backgroundColor: theme.colors.componentInteractive, color: theme.colors.textLowContrast,