From f0eca6885d1a27f9adcca81ab0f5dc3250a6d1d6 Mon Sep 17 00:00:00 2001 From: Lars Hampe Date: Mon, 30 Sep 2024 23:21:05 +0200 Subject: [PATCH] feat(app): add base layout --- apps/app/biome.json | 33 ++++++++++ apps/app/src/components/Layout.tsx | 56 +++++++++++++++++ apps/app/src/components/Navigation.tsx | 58 ++++++++++++++++++ apps/app/src/components/NavigationMobile.tsx | 64 ++++++++++++++++++++ apps/app/src/routes/__root.tsx | 16 +---- 5 files changed, 214 insertions(+), 13 deletions(-) create mode 100644 apps/app/biome.json create mode 100644 apps/app/src/components/Layout.tsx create mode 100644 apps/app/src/components/Navigation.tsx create mode 100644 apps/app/src/components/NavigationMobile.tsx diff --git a/apps/app/biome.json b/apps/app/biome.json new file mode 100644 index 0000000..8ac0481 --- /dev/null +++ b/apps/app/biome.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.2/schema.json", + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "ignoreUnknown": false, + "ignore": ["*.gen.ts"] + }, + "formatter": { + "enabled": true, + "indentStyle": "tab" + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "correctness": { + "noChildrenProp": "off" + } + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + } +} diff --git a/apps/app/src/components/Layout.tsx b/apps/app/src/components/Layout.tsx new file mode 100644 index 0000000..96c3a91 --- /dev/null +++ b/apps/app/src/components/Layout.tsx @@ -0,0 +1,56 @@ +import { CircleUser } from 'lucide-react' + +import { + Button, + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from '@boring.tools/ui' +import { SignOutButton, useUser } from '@clerk/clerk-react' +import type { ReactNode } from 'react' +import { Navigation } from './Navigation' +import { NavigationMobile } from './NavigationMobile' + +export const description = + 'A products dashboard with a sidebar navigation and a main content area. The dashboard has a header with a search input and a user menu. The sidebar has a logo, navigation links, and a card with a call to action. The main content area shows an empty state with a call to action.' + +export const Layout = ({ children }: { children: ReactNode | ReactNode[] }) => { + const { user } = useUser() + return ( +
+ +
+
+ +
+ + + + + + My Account + + + + + + + + +
+
+ {children} +
+
+
+ ) +} diff --git a/apps/app/src/components/Navigation.tsx b/apps/app/src/components/Navigation.tsx new file mode 100644 index 0000000..e2d4dbb --- /dev/null +++ b/apps/app/src/components/Navigation.tsx @@ -0,0 +1,58 @@ +import { + Button, + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from '@boring.tools/ui' +import { Link } from '@tanstack/react-router' +import { BellIcon, HomeIcon } from 'lucide-react' + +export const Navigation = () => { + return ( +
+
+
+ + boring.tools + + +
+
+ +
+
+ + + More Infos + + If you want more informations about boring.tools, visit our + documenation! + + + + + + + + +
+
+
+ ) +} diff --git a/apps/app/src/components/NavigationMobile.tsx b/apps/app/src/components/NavigationMobile.tsx new file mode 100644 index 0000000..1a15b29 --- /dev/null +++ b/apps/app/src/components/NavigationMobile.tsx @@ -0,0 +1,64 @@ +import { + Button, + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, + Sheet, + SheetContent, + SheetTrigger, +} from '@boring.tools/ui' +import { Link } from '@tanstack/react-router' +import { HomeIcon, MenuIcon } from 'lucide-react' + +export const NavigationMobile = () => { + return ( + + + + + + +
+ + + More Infos + + If you want more informations about boring.tools, visit our + documenation! + + + + + + + + +
+
+
+ ) +} diff --git a/apps/app/src/routes/__root.tsx b/apps/app/src/routes/__root.tsx index f5e2bb2..a01555d 100644 --- a/apps/app/src/routes/__root.tsx +++ b/apps/app/src/routes/__root.tsx @@ -2,6 +2,7 @@ import { ThemeToggle } from '@boring.tools/ui' import { SignIn, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react' import { Link, Outlet, createRootRoute } from '@tanstack/react-router' import { TanStackRouterDevtools } from '@tanstack/router-devtools' +import { Layout } from '../components/Layout' export const Route = createRootRoute({ component: () => ( @@ -12,21 +13,10 @@ export const Route = createRootRoute({ - <> -
- - Home - {' '} - - About - - - -
-
+ {!import.meta.env.PROD && } - +
),