From aa9b7be7d4bdb7ad2d5b31583962f7433f999676 Mon Sep 17 00:00:00 2001 From: Eero Holmala Date: Sat, 1 Jun 2024 11:21:04 +0300 Subject: [PATCH] Frontend: add twMerge to components --- .../src/components/ui/content-box.tsx | 8 +++++--- .../src/components/ui/form-input.tsx | 8 +++++--- wretched-machines-frontend/src/components/ui/form.tsx | 3 ++- wretched-machines-frontend/src/components/ui/navbar.tsx | 4 ++-- .../src/components/ui/page-title.tsx | 4 +++- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/wretched-machines-frontend/src/components/ui/content-box.tsx b/wretched-machines-frontend/src/components/ui/content-box.tsx index 59d7915..5f330f9 100644 --- a/wretched-machines-frontend/src/components/ui/content-box.tsx +++ b/wretched-machines-frontend/src/components/ui/content-box.tsx @@ -1,3 +1,5 @@ +import { cn } from "@/lib/utils" + interface ContentBoxProps { title: string, children: React.ReactNode @@ -5,9 +7,9 @@ interface ContentBoxProps { const ContentBox = (props: ContentBoxProps)=>{ return( -
-
{props.title}
-
+
+
{props.title}
+
{props.children}
diff --git a/wretched-machines-frontend/src/components/ui/form-input.tsx b/wretched-machines-frontend/src/components/ui/form-input.tsx index d7309ad..de3378e 100644 --- a/wretched-machines-frontend/src/components/ui/form-input.tsx +++ b/wretched-machines-frontend/src/components/ui/form-input.tsx @@ -1,3 +1,5 @@ +import { cn } from "@/lib/utils" + interface FormTextInputProps { value: string, name: string, @@ -23,18 +25,18 @@ interface FormLabelProps { const FormLabel = (props: FormLabelProps) => { const label = props.name.charAt(0).toUpperCase() + props.name.slice(1); - return(); + return(); } const FormTextInput = (props: FormTextInputProps) => { return( - + ); } const FormSubmitInput = (props: FormSubmitInputProps) => { return( - {props.children} + {props.children} ); } diff --git a/wretched-machines-frontend/src/components/ui/form.tsx b/wretched-machines-frontend/src/components/ui/form.tsx index df2ac9b..4556bf0 100644 --- a/wretched-machines-frontend/src/components/ui/form.tsx +++ b/wretched-machines-frontend/src/components/ui/form.tsx @@ -1,4 +1,5 @@ import React from "react" +import { cn } from "@/lib/utils" interface FormProps { children: React.ReactNode, @@ -8,7 +9,7 @@ interface FormProps { const Form = (props: FormProps) => { return( -
+ {props.children}
); diff --git a/wretched-machines-frontend/src/components/ui/navbar.tsx b/wretched-machines-frontend/src/components/ui/navbar.tsx index 95466b5..628ef6f 100644 --- a/wretched-machines-frontend/src/components/ui/navbar.tsx +++ b/wretched-machines-frontend/src/components/ui/navbar.tsx @@ -1,9 +1,9 @@ import Link from "next/link"; - +import { cn } from "@/lib/utils" const Navbar = () => { return ( -
+
Home
diff --git a/wretched-machines-frontend/src/components/ui/page-title.tsx b/wretched-machines-frontend/src/components/ui/page-title.tsx index 0e4541b..ee3d6f8 100644 --- a/wretched-machines-frontend/src/components/ui/page-title.tsx +++ b/wretched-machines-frontend/src/components/ui/page-title.tsx @@ -1,3 +1,5 @@ +import { cn } from "@/lib/utils" + interface PageTitleProps { title: string } @@ -14,7 +16,7 @@ const AddSpacing = (text: string) : string => { const PageTitle = (props: PageTitleProps)=>{ const title = AddSpacing(props.title); return( -

{title}

+

{title}

); }