From 887d3f6841cca468a138def419569d577818a05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o?= <43091603+glazk0@users.noreply.github.com> Date: Sat, 4 Feb 2023 23:25:38 +0100 Subject: [PATCH] Responsive puzzles & button --- app/dashboard/puzzles/page.tsx | 27 +++++++++++++++++++++++---- ui/Button.tsx | 26 ++++++++++++++++++++++++++ ui/Input.tsx | 2 +- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 ui/Button.tsx diff --git a/app/dashboard/puzzles/page.tsx b/app/dashboard/puzzles/page.tsx index b09e966..54c053f 100644 --- a/app/dashboard/puzzles/page.tsx +++ b/app/dashboard/puzzles/page.tsx @@ -1,7 +1,9 @@ +import Button from '@/ui/Button'; import Input from '@/ui/Input'; import ToHTML from '@/ui/ToHTML'; export default function Page() { + // on va utiliser react-hook-form https://react-hook-form.com/ return (
@@ -11,10 +13,27 @@ export default function Page() {
-
- - -
+
+
+ + +
+ +
); } diff --git a/ui/Button.tsx b/ui/Button.tsx new file mode 100644 index 0000000..86f62e3 --- /dev/null +++ b/ui/Button.tsx @@ -0,0 +1,26 @@ +import { cn } from '@/lib/utils'; +import { forwardRef } from 'react'; + +const Button = forwardRef< + HTMLButtonElement, + React.ButtonHTMLAttributes & { + kind?: 'default' | 'outline' | 'danger'; + } +>(({ kind = 'default', className, ...props }, ref) => ( +