From 1ae657daa8d520b602df9bc3fb0210e41810a9d1 Mon Sep 17 00:00:00 2001 From: Sonny Date: Thu, 8 Jun 2023 23:25:55 +0200 Subject: [PATCH] feat: make all forms responsive --- src/components/FormLayout.tsx | 42 ++++++++----------- src/components/Modal/modal.module.scss | 2 +- src/pages/category/create.tsx | 10 ++--- src/pages/category/edit/[cid].tsx | 4 +- src/pages/category/remove/[cid].tsx | 4 +- src/pages/link/create.tsx | 4 +- src/pages/link/edit/[lid].tsx | 13 +++--- src/pages/link/remove/[lid].tsx | 4 +- .../{create.module.scss => form.module.scss} | 20 +++++---- 9 files changed, 48 insertions(+), 55 deletions(-) rename src/styles/{create.module.scss => form.module.scss} (59%) diff --git a/src/components/FormLayout.tsx b/src/components/FormLayout.tsx index b552150..2b599fe 100644 --- a/src/components/FormLayout.tsx +++ b/src/components/FormLayout.tsx @@ -3,8 +3,6 @@ import Link from "next/link"; import MessageManager from "components/MessageManager/MessageManager"; -import styles from "styles/create.module.scss"; - interface FormProps { title: string; @@ -39,29 +37,23 @@ export default function Form({ return ( <> -
-

{title}

-
- {children} - -
- {!disableHomeLink && ( - - ← Revenir à l'accueil - - )} - -
+

{title}

+
+ {children} + +
+ {!disableHomeLink && ( + + ← Revenir à l'accueil + + )} + ); } diff --git a/src/components/Modal/modal.module.scss b/src/components/Modal/modal.module.scss index fa1ef27..1b1dd44 100644 --- a/src/components/Modal/modal.module.scss +++ b/src/components/Modal/modal.module.scss @@ -53,7 +53,7 @@ @media (max-width: 768px) { .modal-container { - height: calc(100% - 2em); + max-height: calc(100% - 2em); width: calc(100% - 2em); min-width: unset; margin-top: 1em; diff --git a/src/pages/category/create.tsx b/src/pages/category/create.tsx index a46538e..b1cfdf2 100644 --- a/src/pages/category/create.tsx +++ b/src/pages/category/create.tsx @@ -9,14 +9,14 @@ import TextBox from "components/TextBox"; import PATHS from "constants/paths"; import useAutoFocus from "hooks/useAutoFocus"; -import { redirectWithoutClientCache } from "utils/client"; -import { HandleAxiosError } from "utils/front"; - import getUserCategoriesCount from "lib/category/getUserCategoriesCount"; import getUser from "lib/user/getUser"; -import styles from "styles/create.module.scss"; +import { redirectWithoutClientCache } from "utils/client"; +import { HandleAxiosError } from "utils/front"; import { getSession } from "utils/session"; +import styles from "styles/form.module.scss"; + function CreateCategory({ categoriesCount }: { categoriesCount: number }) { const autoFocusRef = useAutoFocus(); const router = useRouter(); @@ -52,7 +52,7 @@ function CreateCategory({ categoriesCount }: { categoriesCount: number }) { }; return ( - + + + + + +