From 6d861c71cc1a10781e8eff93196d18147ff6be7a Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Fri, 8 Mar 2024 09:57:50 +0700 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=8E=A8=20style:=20adjust=20filter=20f?= =?UTF-8?q?orm=20mobile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/projects/project/deployments/FilterForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx b/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx index 3668b7ac..348ecaf0 100644 --- a/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx +++ b/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx @@ -75,7 +75,7 @@ const FilterForm = ({ value, onChange }: FilterFormProps) => { }; return ( -
+
Date: Fri, 8 Mar 2024 09:58:26 +0700 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=8E=A8=20style:=20adjust=20responsive?= =?UTF-8?q?=20for=20deployment=20details=20card?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deployments/DeploymentDetailsCard.tsx | 175 ++++++++++-------- 1 file changed, 102 insertions(+), 73 deletions(-) diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx index c4940bac..3c964344 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useCallback } from 'react'; import { Deployment, DeploymentStatus, @@ -60,85 +60,114 @@ const DeploymentDetailsCard = ({ } }; - return ( -
-
- {/* DEPLOYMENT URL */} - {deployment.url && ( - - - {deployment.url} - - - )} - - {deployment.environment === Environment.Production - ? `Production ${deployment.isCurrent ? '(Current)' : ''}` - : 'Preview'} - -
- - {/* DEPLOYMENT STATUS */} -
- - {deployment.status} - -
- - {/* DEPLOYMENT COMMIT DETAILS */} -
- - - {deployment.branch} - - - - - {deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH)}{' '} - {deployment.commitMessage} - - -
- - {/* DEPLOYMENT INFOs */} -
-
- - - {relativeTimeMs(deployment.createdAt)} - -
- -
- - - {formatAddress(deployment.createdBy.name ?? '')} - -
+ const renderDeploymentMenu = useCallback( + (className?: string) => { + return ( + ); + }, + [deployment, currentDeployment, onUpdate, project, prodBranchDomains], + ); + + const renderDeploymentStatus = useCallback( + (className?: string) => { + return ( +
+ + {deployment.status} + +
+ ); + }, + [deployment.status, deployment.commitHash], + ); + + return ( +
+
+
+ {/* DEPLOYMENT URL */} + {deployment.url && ( + + + {deployment.url} + + + )} + + {deployment.environment === Environment.Production + ? `Production ${deployment.isCurrent ? '(Current)' : ''}` + : 'Preview'} + +
+ {/* MENU ON MOBILE */} + {renderDeploymentMenu('flex md:hidden ml-auto')} +
+ + {/* DEPLOYMENT STATUS */} + {renderDeploymentStatus('w-[10%] max-w-[110px] hidden md:flex h-fit')} + + {/* DEPLOYMENT COMMIT DETAILS */} +
+
+ + + + {deployment.branch} + + + + + + {deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH)}{' '} + {deployment.commitMessage} + + +
+ {renderDeploymentStatus('flex md:hidden h-fit')} +
+ + {/* DEPLOYMENT INFOs */} +
+
+
+ + + {relativeTimeMs(deployment.createdAt)} + +
+
+
+ +
+ + {formatAddress(deployment.createdBy.name ?? '')} + +
+
+ {renderDeploymentMenu('ml-auto hidden md:flex')}
); From 65b66fe3831234339baaf360cb50793931aebd3e Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Fri, 8 Mar 2024 10:35:22 +0700 Subject: [PATCH 3/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20remove=20e?= =?UTF-8?q?mpty=20space?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/project/deployments/DeploymentDetailsCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx index 3c964344..8caf9ad1 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx @@ -95,7 +95,7 @@ const DeploymentDetailsCard = ({ return (
-
+
{/* DEPLOYMENT URL */} {deployment.url && ( From de197759deaed43a4257f7d2f48cc1acc47dde9d Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Fri, 8 Mar 2024 10:36:14 +0700 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=8E=A8=20style:=20remove=20width=20an?= =?UTF-8?q?d=20height=20icon=20style=20from=20tag=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/shared/Tag/Tag.theme.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/shared/Tag/Tag.theme.ts b/packages/frontend/src/components/shared/Tag/Tag.theme.ts index 884f79bc..1aec8467 100644 --- a/packages/frontend/src/components/shared/Tag/Tag.theme.ts +++ b/packages/frontend/src/components/shared/Tag/Tag.theme.ts @@ -36,11 +36,11 @@ export const tagTheme = tv( size: { sm: { wrapper: ['px-2', 'py-2'], - icon: ['h-4', 'w-4'], + icon: [], }, xs: { wrapper: ['px-2', 'py-1'], - icon: ['h-3', 'w-3'], + icon: [], }, }, }, From 519618b4568d72ac4906b9e67a9b1ed2cc6726c1 Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Fri, 8 Mar 2024 12:42:42 +0700 Subject: [PATCH 5/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20remove=20d?= =?UTF-8?q?uplicate=20component=20and=20use=20absolute=20for=20the=20mobil?= =?UTF-8?q?e=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deployments/DeploymentDetailsCard.tsx | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx index 8caf9ad1..09bfe11c 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx @@ -60,22 +60,6 @@ const DeploymentDetailsCard = ({ } }; - const renderDeploymentMenu = useCallback( - (className?: string) => { - return ( - - ); - }, - [deployment, currentDeployment, onUpdate, project, prodBranchDomains], - ); - const renderDeploymentStatus = useCallback( (className?: string) => { return ( @@ -94,9 +78,9 @@ const DeploymentDetailsCard = ({ ); return ( -
+
-
+
{/* DEPLOYMENT URL */} {deployment.url && (
- {/* MENU ON MOBILE */} - {renderDeploymentMenu('flex md:hidden ml-auto')}
{/* DEPLOYMENT STATUS */} @@ -167,7 +149,14 @@ const DeploymentDetailsCard = ({
- {renderDeploymentMenu('ml-auto hidden md:flex')} +
);