From 62656fa96393a9e1a9e7ee26145a3f8dd9c05997 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Wed, 14 Jun 2023 16:33:08 +0200 Subject: [PATCH] feat: reworked page and components --- app/(index)/layout.tsx | 33 ++++++++++++ app/(index)/page.tsx | 43 +++++++++++++++ app/page.tsx | 113 --------------------------------------- components/ui/button.tsx | 51 ++++++++++++++++++ config/navigation.ts | 8 +++ config/site.ts | 14 +++++ lib/utils.ts | 15 ++++++ types/index.d.ts | 11 ++++ 8 files changed, 175 insertions(+), 113 deletions(-) create mode 100644 app/(index)/layout.tsx create mode 100644 app/(index)/page.tsx delete mode 100644 app/page.tsx create mode 100644 components/ui/button.tsx create mode 100644 config/navigation.ts create mode 100644 config/site.ts create mode 100644 lib/utils.ts create mode 100644 types/index.d.ts diff --git a/app/(index)/layout.tsx b/app/(index)/layout.tsx new file mode 100644 index 0000000..3968f6c --- /dev/null +++ b/app/(index)/layout.tsx @@ -0,0 +1,33 @@ +import Link from "next/link"; + +import { cn } from "@/lib/utils"; +import { buttonVariants } from "@/components/ui/button"; + +interface MarketingLayoutProps { + children: React.ReactNode; +} + +export default async function MarketingLayout({ + children, +}: MarketingLayoutProps) { + return ( +
+
+
+ +
+
+
{children}
+
+ ); +} diff --git a/app/(index)/page.tsx b/app/(index)/page.tsx new file mode 100644 index 0000000..bdf1a1d --- /dev/null +++ b/app/(index)/page.tsx @@ -0,0 +1,43 @@ +import Link from "next/link"; + +import { siteConfig } from "@/config/site"; +import { cn } from "@/lib/utils"; +import { buttonVariants } from "@/components/ui/button"; + +export default function IndexPage() { + return ( + <> +
+
+ + View my LinkedIn profile + +

+ hellob.art +

+

+ In progress build of my portfolio using Next.js 13 server + components. +

+
+ + Get Started + + + GitHub + +
+
+
+ + ); +} diff --git a/app/page.tsx b/app/page.tsx deleted file mode 100644 index 745df65..0000000 --- a/app/page.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import Image from 'next/image' - -export default function Home() { - return ( -
-
-

- Get started by editing  - app/page.tsx -

-
- - By{' '} - Vercel Logo - -
-
- -
- Next.js Logo -
- -
- -

- Docs{' '} - - -> - -

-

- Find in-depth information about Next.js features and API. -

-
- - -

- Learn{' '} - - -> - -

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

- Templates{' '} - - -> - -

-

- Explore the Next.js 13 playground. -

-
- - -

- Deploy{' '} - - -> - -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

-
-
-
- ) -} diff --git a/components/ui/button.tsx b/components/ui/button.tsx new file mode 100644 index 0000000..0ec0799 --- /dev/null +++ b/components/ui/button.tsx @@ -0,0 +1,51 @@ +import * as React from "react"; +import { VariantProps, cva } from "class-variance-authority"; + +import { cn } from "@/lib/utils"; + +const buttonVariants = cva( + "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground hover:bg-primary/90", + destructive: + "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: + "border border-input hover:bg-accent hover:text-accent-foreground", + secondary: + "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "underline-offset-4 hover:underline text-primary", + }, + size: { + default: "h-10 py-2 px-4", + sm: "h-9 px-3 rounded-md", + lg: "h-11 px-8 rounded-md", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + } +); + +export interface ButtonProps + extends React.ButtonHTMLAttributes, + VariantProps {} + +const Button = React.forwardRef( + ({ className, variant, size, ...props }, ref) => { + return ( +