From 12fe9e9aa4fd4075aeeac8371790298099111e72 Mon Sep 17 00:00:00 2001 From: prostarz Date: Tue, 7 Jan 2025 18:21:14 +0000 Subject: [PATCH] feat(ui): make modals more responsive --- .../actions/edit.tsx | 3 +- .../modals/newGame/forms/metadata.tsx | 2 +- .../modals/newGame/forms/settings.tsx | 2 +- .../components/modals/newGame/index.tsx | 68 ++--- .../library/components/updateForm.tsx | 241 +++++++++--------- 5 files changed, 161 insertions(+), 155 deletions(-) diff --git a/src/features/library/components/cards/continuePlaying/ContinuePlayingCardOverlay/actions/edit.tsx b/src/features/library/components/cards/continuePlaying/ContinuePlayingCardOverlay/actions/edit.tsx index f055861..2536a7f 100644 --- a/src/features/library/components/cards/continuePlaying/ContinuePlayingCardOverlay/actions/edit.tsx +++ b/src/features/library/components/cards/continuePlaying/ContinuePlayingCardOverlay/actions/edit.tsx @@ -25,10 +25,11 @@ const UpdateDialog = ({ fetchGames, updateGame, game }: UpdateDialogProps) => { {t("update")} - + {t("update_game")} + { updateGame(game.game_id, { diff --git a/src/features/library/components/modals/newGame/forms/metadata.tsx b/src/features/library/components/modals/newGame/forms/metadata.tsx index 3281f5b..ebf0190 100644 --- a/src/features/library/components/modals/newGame/forms/metadata.tsx +++ b/src/features/library/components/modals/newGame/forms/metadata.tsx @@ -17,7 +17,7 @@ const NewGameMetadataForm = ({ form }: NewGameMetadataFormProps) => { useFormActions(form); return ( -
+
{ const { handleWinePrefixButton } = useFormActions(form); return ( -
+
{ }; return ( - - - - - {t("new_game")} - + + + + {t("new_game")} @@ -87,34 +86,39 @@ const NewGameModal = () => {
- - - - - - - +
+ + + + + -
- - - - - - - - -
- + + + + +
+
-
-
+ +
+ + + + + + + + +
+ + ); }; diff --git a/src/features/library/components/updateForm.tsx b/src/features/library/components/updateForm.tsx index 0358f9f..7c2c07c 100644 --- a/src/features/library/components/updateForm.tsx +++ b/src/features/library/components/updateForm.tsx @@ -1,7 +1,7 @@ import { P } from "@/components/typography/p"; import { Button } from "@/components/ui/button"; -import { DialogClose, DialogFooter } from "@/components/ui/dialog"; import { Form, FormField } from "@/components/ui/form"; +import { ScrollArea } from "@/components/ui/scroll-area"; import { useLanguageContext } from "@/contexts/I18N"; import { zodResolver } from "@hookform/resolvers/zod"; import { FolderOpen } from "lucide-react"; @@ -83,136 +83,137 @@ const UpdateGameForm = ({ defaultValues, onSubmit }: UpdateGameFormProps) => { return (
- - ( - + + + ( + + )} + /> + + ( + + + + } + required + field={field} + /> + )} /> - )} - /> - - ( - - - - } - required - field={field} + + ( + + + + } + field={field} + /> + )} /> - )} - /> - - ( - - - - } - field={field} + + ( + <> + + {form.formState.errors.gameArgs && ( +

+ {form.formState.errors.gameArgs.message} +

+ )} + + )} /> - )} - /> - - ( - <> - - {form.formState.errors.gameArgs && ( -

- {form.formState.errors.gameArgs.message} -

+ + ( + )} - - )} - /> - - ( - - )} - /> - - ( - ( + + )} /> - )} - /> - - ( - ( + + )} /> - )} - /> - - ( - ( + + )} /> - )} - /> - - - - - - + +
+
+ +
- +
{error &&

{error}

} );