feat: added disabled tools

This commit is contained in:
TrèsAbhi committed 2023-10-01 11:35:44 -05:00
1 parent b39f545669
commit 01bd3f8d68
4 files changed
+71 -61

No files matched your search

+2 -9
View File
@@ -1,6 +1,6 @@
'use client'; 'use client';
import { Theme } from '@radix-ui/themes'; import { Flex, 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';
@@ -41,14 +41,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
> >
{!isEmbed && <Navbar />} {!isEmbed && <Navbar />}
<div <Flex direction="column">{children}</Flex>
style={{
flex: 1,
width: '100%',
}}
>
{children}
</div>
</Theme> </Theme>
</body> </body>
</html> </html>
+10 -20
View File
@@ -1,25 +1,15 @@
import { style } from '@vanilla-extract/css'; import { styleVariants } from '@vanilla-extract/css';
import { theme } from '../stitches.config'; import { theme } from '../stitches.config';
export const tool = style({ export const tool = styleVariants({
height: 128, enabled: {
minWidth: 256, boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`,
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}`,
':hover': { ':hover': {
boxShadow: `inset 0 -128px 128px -128px ${theme.colors.appBackground1}`, boxShadow: `inset 0 -160px 128px -128px ${theme.colors.appBackground1}`,
},
},
disabled: {
boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`,
}, },
}); });
+27 -11
View File
@@ -1,7 +1,7 @@
'use client'; 'use client';
import { CaretRightIcon, MagnifyingGlassIcon } from '@radix-ui/react-icons'; 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 Link from 'next/link';
import { useRef } from 'react'; import { useRef } from 'react';
import { Search, SearchItem } from 'react-fuzzysort'; import { Search, SearchItem } from 'react-fuzzysort';
@@ -22,13 +22,7 @@ export default function Page() {
<TextField.Input ref={input} placeholder="Search tools..." /> <TextField.Input ref={input} placeholder="Search tools..." />
</TextField.Root> </TextField.Root>
<div <Flex gap="3" wrap="wrap" align="center" justify="center">
style={{
display: 'flex',
gap: 16,
flexWrap: 'wrap',
}}
>
<Search <Search
input={input} input={input}
list={TOOLS.map( list={TOOLS.map(
@@ -37,9 +31,31 @@ export default function Page() {
node: ( node: (
<Link <Link
href={`/tools/${tool.id}`} href={`/tools/${tool.id}`}
className={styles.tool} className={
tool.disabled ? styles.tool.disabled : styles.tool.enabled
}
style={{ style={{
backgroundImage: `url(/assets/banners/${tool.id}.png)`, backgroundImage: `url(/assets/banners/${tool.id}.png)`,
cursor: tool.disabled ? 'default' : 'pointer',
opacity: tool.disabled ? 0.25 : 1,
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,
transition: `box-shadow ${theme.durations.regular}`,
}}
onClick={(event) => {
if (tool.disabled) event.preventDefault();
}} }}
> >
<span <span
@@ -60,7 +76,7 @@ export default function Page() {
fontSize: 16, fontSize: 16,
}} }}
> >
{tool.description} {tool.disabled ? 'Coming soon!' : tool.description}
</span> </span>
</Link> </Link>
), ),
@@ -68,7 +84,7 @@ export default function Page() {
}) satisfies SearchItem, }) satisfies SearchItem,
)} )}
/> />
</div> </Flex>
</PageWrapper> </PageWrapper>
); );
} }
+32 -21
View File
@@ -1,29 +1,40 @@
export const TOOLS = [ interface Tool {
id: string;
title: string;
description: string;
disabled?: boolean;
}
export const TOOLS: Tool[] = [
{ {
id: 'session', id: 'session',
title: 'Session tracker', title: 'Session tracker',
description: 'Track your performance in a session', description: 'Track your performance in a session',
}, },
// { {
// id: 'ratings', id: 'ratings',
// title: 'Ratings', title: 'Ratings',
// description: 'Current and old season leader boards', description: 'Current and old season leader boards',
// }, disabled: true,
// { },
// id: 'tankopedia', {
// title: 'Tankopedia', id: 'tankopedia',
// description: 'Full Blitz tank encyclopedia', title: 'Tankopedia',
// }, description: 'Full Blitz tank encyclopedia',
// { disabled: true,
// id: 'inactive', },
// title: 'Inactivity tracker', {
// description: 'Find inactive members of a clan', id: 'inactive',
// }, title: 'Inactivity tracker',
// { description: 'Find inactive members of a clan',
// id: 'profile', disabled: true,
// title: 'Player profile', },
// description: "A player's basic non-statistical info", {
// }, id: 'profile',
title: 'Player profile',
description: "A player's basic non-statistical info",
disabled: true,
},
// { // {
// title: 'More coming soon', // title: 'More coming soon',
// description: 'New tools are added often', // description: 'New tools are added often',