From 274762cbfecd8700636a6fdcb30f14bb49822451 Mon Sep 17 00:00:00 2001 From: Andre H Date: Wed, 6 Mar 2024 14:14:10 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20feat:=20create=20proje?= =?UTF-8?q?ct=20mobile=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org-slug/projects/create/Template.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/pages/org-slug/projects/create/Template.tsx b/packages/frontend/src/pages/org-slug/projects/create/Template.tsx index 3d61792d..1f4236ff 100644 --- a/packages/frontend/src/pages/org-slug/projects/create/Template.tsx +++ b/packages/frontend/src/pages/org-slug/projects/create/Template.tsx @@ -14,11 +14,15 @@ import { } from 'components/shared/CustomIcon'; import { Heading } from 'components/shared/Heading'; import { Steps } from 'components/shared/Steps'; +import { useMediaQuery } from 'usehooks-ts'; // TODO: Set dynamic route for template and load details from DB const CreateWithTemplate = () => { const { orgSlug } = useParams(); + const isDesktopView = useMediaQuery('(min-width: 720px)'); // md: + const stepsOrientation = isDesktopView ? 'vertical' : 'horizontal'; + const stepperValues = [ { step: 1, @@ -47,7 +51,7 @@ const CreateWithTemplate = () => { ); return ( -
+
@@ -69,11 +73,15 @@ const CreateWithTemplate = () => {
-
-
- +
+
+
-
+
From 3737550f7f8b429b8849abe47039a20809b38bc2 Mon Sep 17 00:00:00 2001 From: Andre H Date: Wed, 6 Mar 2024 14:14:49 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=94=A7=20chore:=20useMediaQuery=20cha?= =?UTF-8?q?nge=20md=20to=20>720px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/pages/org-slug/projects/Id.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/pages/org-slug/projects/Id.tsx b/packages/frontend/src/pages/org-slug/projects/Id.tsx index cf333ba3..60c2f073 100644 --- a/packages/frontend/src/pages/org-slug/projects/Id.tsx +++ b/packages/frontend/src/pages/org-slug/projects/Id.tsx @@ -24,7 +24,7 @@ const Id = () => { const client = useGQLClient(); const location = useLocation(); - const isDesktopView = useMediaQuery('(min-width: 768px)'); // md: + const isDesktopView = useMediaQuery('(min-width: 720px)'); // md: const buttonSize = isDesktopView ? {} : { size: 'sm' as const }; const [project, setProject] = useState(null); From f23c757de9f11d03102e829eaa04e88fc7685f8d Mon Sep 17 00:00:00 2001 From: Andre H Date: Wed, 6 Mar 2024 14:15:19 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=94=A7=20chore:=20create=20project=20?= =?UTF-8?q?create=20repo=20buttonSize=20to=20be=20responsive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/shared/Button/Button.theme.ts | 2 +- .../src/pages/org-slug/projects/create/template/index.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/shared/Button/Button.theme.ts b/packages/frontend/src/components/shared/Button/Button.theme.ts index 262cb8f9..eedb9b24 100644 --- a/packages/frontend/src/components/shared/Button/Button.theme.ts +++ b/packages/frontend/src/components/shared/Button/Button.theme.ts @@ -20,7 +20,7 @@ export const buttonTheme = tv( variants: { size: { lg: ['gap-2', 'py-3.5', 'px-5', 'text-base', 'tracking-[-0.011em]'], - md: ['gap-2', 'py-3.25', 'px-5', 'text-sm', 'tracking-[-0.006em]'], + md: ['gap-2', 'py-3', 'px-5', 'text-sm', 'tracking-[-0.006em]'], sm: ['gap-1', 'py-2', 'px-3', 'text-xs'], xs: ['gap-1', 'py-1', 'px-2', 'text-xs'], }, diff --git a/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx b/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx index 9fc8795e..f57428e1 100644 --- a/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx +++ b/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx @@ -3,6 +3,7 @@ import { useForm, SubmitHandler, Controller } from 'react-hook-form'; import { useNavigate, useOutletContext, useParams } from 'react-router-dom'; import toast from 'react-hot-toast'; import assert from 'assert'; +import { useMediaQuery } from 'usehooks-ts'; import { useOctokit } from '../../../../../context/OctokitContext'; import { useGQLClient } from '../../../../../context/GQLClientContext'; @@ -28,6 +29,9 @@ const CreateRepo = () => { const { orgSlug } = useParams(); + const isDesktopView = useMediaQuery('(min-width: 720px)'); // md: + const buttonSize = isDesktopView ? { size: 'lg' as const } : {}; + const navigate = useNavigate(); const [gitAccounts, setGitAccounts] = useState([]); @@ -166,8 +170,8 @@ const CreateRepo = () => {