From 33b4ea04b4c0e567e76f27c4b1b65d275611e776 Mon Sep 17 00:00:00 2001 From: tresabhi Date: Mon, 18 Sep 2023 22:32:21 +0000 Subject: [PATCH] feat: session toolbar --- src/app/page.tsx | 91 +++++++++++++------------------ src/app/tools/session/page.css.ts | 23 ++++++++ src/app/tools/session/page.tsx | 28 +++++++++- src/components/Button.tsx | 39 +++++++++++++ src/components/PageWrapper.tsx | 29 +++++++--- src/components/SearchBar.tsx | 5 +- src/stitches.config.ts | 15 ++++- 7 files changed, 165 insertions(+), 65 deletions(-) create mode 100644 src/app/tools/session/page.css.ts create mode 100644 src/components/Button.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index 2ec4814ba..e1bf18b6b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -48,67 +48,54 @@ export default function Page() { 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/session/page.css.ts b/src/app/tools/session/page.css.ts new file mode 100644 index 000000000..a15b1efa9 --- /dev/null +++ b/src/app/tools/session/page.css.ts @@ -0,0 +1,23 @@ +import { style } from '@vanilla-extract/css'; + +export const toolBar = style({ + '@media': { + 'screen and (min-width: 640px)': { + flexDirection: 'row', + }, + }, + + flexDirection: 'column', + display: 'flex', + gap: 8, +}); + +export const button = style({ + '@media': { + 'screen and (min-width: 640px)': { + flex: 0, + }, + }, + + flex: 1, +}); diff --git a/src/app/tools/session/page.tsx b/src/app/tools/session/page.tsx index f4af4b146..d3c9e61b0 100644 --- a/src/app/tools/session/page.tsx +++ b/src/app/tools/session/page.tsx @@ -1,3 +1,29 @@ +'use client'; + +import { CopyIcon, ListBulletIcon, ReloadIcon } from '@radix-ui/react-icons'; +import { Button } from '../../../components/Button'; +import PageWrapper from '../../../components/PageWrapper'; +import { SearchBar } from '../../../components/SearchBar'; +import * as styles from './page.css'; + export default function Page() { - return 'inner'; + return ( + +
+ + +
+ + + +
+
+
+ ); } diff --git a/src/components/Button.tsx b/src/components/Button.tsx new file mode 100644 index 000000000..8b78fb276 --- /dev/null +++ b/src/components/Button.tsx @@ -0,0 +1,39 @@ +import { ComponentProps } from 'react'; +import { theme } from '../stitches.config'; + +type ButtonColor = 'default' | 'dangerous' | 'recommended'; + +interface ButtonProps extends ComponentProps<'button'> { + color?: ButtonColor; +} + +const BUTTON_COLORS = { + default: '', + dangerous: '_red', + recommended: '_blue', +} as const satisfies Record; + +export function Button({ color, style, ...props }: ButtonProps) { + color = color ?? 'default'; + + return ( +