From f3ce0d062111cf5f2daaeac32f61a0013acf349c Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Thu, 14 Mar 2024 21:52:55 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20style:=20adjust=20deployment=20b?= =?UTF-8?q?ody=20card=20design=20to=20match=20with=20the=20figma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deployments/DeploymentDialogBodyCard.tsx | 81 +++++++++++++------ 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDialogBodyCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDialogBodyCard.tsx index a8b40b8..64b6956 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDialogBodyCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDialogBodyCard.tsx @@ -1,17 +1,23 @@ import React from 'react'; import { Deployment } from 'gql-client'; -import { Typography, Chip, Card } from '@material-tailwind/react'; -import { color } from '@material-tailwind/react/types/components/chip'; -import { relativeTimeMs } from '../../../../utils/time'; +import { relativeTimeMs } from 'utils/time'; import { SHORT_COMMIT_HASH_LENGTH } from '../../../../constants'; -import { formatAddress } from '../../../../utils/format'; +import { + BranchStrokeIcon, + ClockOutlineIcon, + CommitIcon, +} from 'components/shared/CustomIcon'; +import { Avatar } from 'components/shared/Avatar'; +import { getInitials } from 'utils/geInitials'; +import { OverflownText } from 'components/shared/OverflownText'; +import { Tag, TagProps } from 'components/shared/Tag'; interface DeploymentDialogBodyCardProps { deployment: Deployment; chip?: { value: string; - color?: color; + type?: TagProps['type']; }; } @@ -19,31 +25,54 @@ const DeploymentDialogBodyCard = ({ chip, deployment, }: DeploymentDialogBodyCardProps) => { + const commit = + deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH) + + ' ' + + deployment.commitMessage; + return ( - +
{chip && ( - + + {chip.value} + )} - {deployment.url && ( - +
+ {/* Title */} +

{deployment.url} - - )} - - ^ {deployment.branch} ^{' '} - {deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH)}{' '} - {deployment.commitMessage} - - - ^ {relativeTimeMs(deployment.createdAt)} ^{' '} - {formatAddress(deployment.createdBy.name ?? '')} - - +

+ {/* Branch & commit */} +
+
+ +

{deployment.branch}

+
+
+ +

+ {commit} +

+
+
+
+
+ +

+ {relativeTimeMs(deployment.createdAt)} +

+ +

+ {deployment.createdBy.name ?? 'Unknown'} +

+
+
); };