From 01bd3f8d68beac69621567625d560469ff2e9125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sun, 1 Oct 2023 11:35:44 -0500 Subject: [PATCH] feat: added disabled tools --- src/app/layout.tsx | 11 ++------- src/app/page.css.ts | 30 ++++++++---------------- src/app/page.tsx | 38 +++++++++++++++++++++--------- src/constants/tools.ts | 53 +++++++++++++++++++++++++----------------- 4 files changed, 71 insertions(+), 61 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index dd84d1376..1f54bb940 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Theme } from '@radix-ui/themes'; +import { Flex, Theme } from '@radix-ui/themes'; import '@radix-ui/themes/styles.css'; import { config } from 'dotenv'; import { Roboto_Flex } from 'next/font/google'; @@ -41,14 +41,7 @@ export default function RootLayout({ children }: RootLayoutProps) { > {!isEmbed && } -
- {children} -
+ {children} diff --git a/src/app/page.css.ts b/src/app/page.css.ts index 7fbd76b86..a4c4ebbc6 100644 --- a/src/app/page.css.ts +++ b/src/app/page.css.ts @@ -1,25 +1,15 @@ -import { style } from '@vanilla-extract/css'; +import { styleVariants } from '@vanilla-extract/css'; import { theme } from '../stitches.config'; -export const tool = style({ - height: 128, - minWidth: 256, - flex: 1, - borderRadius: 8, - textDecoration: 'none', - backgroundSize: 'cover', - backgroundPosition: 'center', - overflow: 'hidden', - display: 'flex', - flexDirection: 'column', - alignItems: 'flex-start', - justifyContent: 'flex-end', - padding: 16, - gap: 4, - boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`, - transition: `box-shadow ${theme.durations.regular}`, +export const tool = styleVariants({ + enabled: { + boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`, - ':hover': { - boxShadow: `inset 0 -128px 128px -128px ${theme.colors.appBackground1}`, + ':hover': { + boxShadow: `inset 0 -160px 128px -128px ${theme.colors.appBackground1}`, + }, + }, + disabled: { + boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`, }, }); diff --git a/src/app/page.tsx b/src/app/page.tsx index 1bb863b09..8982fa0bd 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,7 @@ 'use client'; import { CaretRightIcon, MagnifyingGlassIcon } from '@radix-ui/react-icons'; -import { TextField } from '@radix-ui/themes'; +import { Flex, TextField } from '@radix-ui/themes'; import Link from 'next/link'; import { useRef } from 'react'; import { Search, SearchItem } from 'react-fuzzysort'; @@ -22,13 +22,7 @@ export default function Page() { -
+ { + if (tool.disabled) event.preventDefault(); }} > - {tool.description} + {tool.disabled ? 'Coming soon!' : tool.description} ), @@ -68,7 +84,7 @@ export default function Page() { }) satisfies SearchItem, )} /> -
+ ); } diff --git a/src/constants/tools.ts b/src/constants/tools.ts index e957ab07c..c9c0b0241 100644 --- a/src/constants/tools.ts +++ b/src/constants/tools.ts @@ -1,29 +1,40 @@ -export const TOOLS = [ +interface Tool { + id: string; + title: string; + description: string; + disabled?: boolean; +} + +export const TOOLS: Tool[] = [ { id: 'session', title: 'Session tracker', description: 'Track your performance in a session', }, - // { - // id: 'ratings', - // title: 'Ratings', - // description: 'Current and old season leader boards', - // }, - // { - // id: 'tankopedia', - // title: 'Tankopedia', - // description: 'Full Blitz tank encyclopedia', - // }, - // { - // id: 'inactive', - // title: 'Inactivity tracker', - // description: 'Find inactive members of a clan', - // }, - // { - // id: 'profile', - // title: 'Player profile', - // description: "A player's basic non-statistical info", - // }, + { + id: 'ratings', + title: 'Ratings', + description: 'Current and old season leader boards', + disabled: true, + }, + { + id: 'tankopedia', + title: 'Tankopedia', + description: 'Full Blitz tank encyclopedia', + disabled: true, + }, + { + id: 'inactive', + title: 'Inactivity tracker', + description: 'Find inactive members of a clan', + disabled: true, + }, + { + id: 'profile', + title: 'Player profile', + description: "A player's basic non-statistical info", + disabled: true, + }, // { // title: 'More coming soon', // description: 'New tools are added often',