From 47cd8079e40c6c8073351cff1d397f2065f9887b Mon Sep 17 00:00:00 2001 From: Sushan Yadav Date: Wed, 28 Feb 2024 11:47:00 +0545 Subject: [PATCH] feat: reskin w/ new design system --- .../projects/project/ActivityCard.tsx | 93 ++++++++++++------- .../CustomIcon/ArrowRightCircleFilledIcon.tsx | 21 +++++ .../src/components/shared/CustomIcon/index.ts | 1 + .../pages/org-slug/projects/id/Overview.tsx | 39 ++++---- 4 files changed, 99 insertions(+), 55 deletions(-) create mode 100644 packages/frontend/src/components/shared/CustomIcon/ArrowRightCircleFilledIcon.tsx diff --git a/packages/frontend/src/components/projects/project/ActivityCard.tsx b/packages/frontend/src/components/projects/project/ActivityCard.tsx index 5fa5ae82..439151ba 100644 --- a/packages/frontend/src/components/projects/project/ActivityCard.tsx +++ b/packages/frontend/src/components/projects/project/ActivityCard.tsx @@ -1,45 +1,74 @@ import React from 'react'; - -import { Typography, IconButton, Avatar } from '@material-tailwind/react'; - -import { relativeTimeISO } from '../../../utils/time'; +import { Link } from 'react-router-dom'; import { GitCommitWithBranch } from '../../../types'; +import { Avatar } from 'components/shared/Avatar'; +import { Button } from 'components/shared/Button'; +import { + ArrowRightCircleFilledIcon, + BranchIcon, +} from 'components/shared/CustomIcon'; +import { formatDistance } from 'date-fns'; interface ActivityCardProps { activity: GitCommitWithBranch; } const ActivityCard = ({ activity }: ActivityCardProps) => { + const formattedDate = formatDistance( + new Date(activity.commit.author!.date!), + new Date(), + { + addSuffix: true, + }, + ); + return ( -
-
- + +
+ +
+
+ + {activity.commit.author?.name} + + + + {formattedDate} + + {/* Dot */} + + +
+ +
+ + {activity.branch.name} + +
+
+

+ {activity.commit.message} +

+
+
-
- {activity.commit.author?.name} - - {relativeTimeISO(activity.commit.author!.date!)} ^{' '} - {activity.branch.name} - - - {activity.commit.message} - -
-
- - {'>'} - -
-
+ +
+ ); }; diff --git a/packages/frontend/src/components/shared/CustomIcon/ArrowRightCircleFilledIcon.tsx b/packages/frontend/src/components/shared/CustomIcon/ArrowRightCircleFilledIcon.tsx new file mode 100644 index 00000000..480f70e4 --- /dev/null +++ b/packages/frontend/src/components/shared/CustomIcon/ArrowRightCircleFilledIcon.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { CustomIcon, CustomIconProps } from './CustomIcon'; + +export const ArrowRightCircleFilledIcon = (props: CustomIconProps) => { + return ( + + + + ); +}; diff --git a/packages/frontend/src/components/shared/CustomIcon/index.ts b/packages/frontend/src/components/shared/CustomIcon/index.ts index 5de3702d..2493420c 100644 --- a/packages/frontend/src/components/shared/CustomIcon/index.ts +++ b/packages/frontend/src/components/shared/CustomIcon/index.ts @@ -32,3 +32,4 @@ export * from './GitHubLogo'; export * from './ClockIcon'; export * from './HorizontalDotIcon'; export * from './WarningDiamondIcon'; +export * from './ArrowRightCircleFilledIcon'; diff --git a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx index aee25875..0ba72dcb 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx @@ -1,15 +1,9 @@ import React, { useEffect, useState } from 'react'; import { Domain, DomainStatus } from 'gql-client'; -import { Link, useNavigate, useOutletContext } from 'react-router-dom'; +import { useNavigate, useOutletContext } from 'react-router-dom'; import { RequestError } from 'octokit'; -import { - Typography, - Button, - Chip, - Avatar, - Tooltip, -} from '@material-tailwind/react'; +import { Typography, Chip, Avatar, Tooltip } from '@material-tailwind/react'; import ActivityCard from '../../../../components/projects/project/ActivityCard'; import { relativeTimeMs } from '../../../../utils/time'; @@ -17,6 +11,7 @@ import { useOctokit } from '../../../../context/OctokitContext'; import { GitCommitWithBranch, OutletContextType } from '../../../../types'; import { useGQLClient } from '../../../../context/GQLClientContext'; import { formatAddress } from '../../../../utils/format'; +import { Button } from 'components/shared/Button'; const COMMITS_PER_PAGE = 4; @@ -107,9 +102,9 @@ const OverviewTabPanel = () => { }, [project]); return ( -
-
-
+
+
+
{ /> @@ -179,21 +174,19 @@ const OverviewTabPanel = () => {
No current deployment found
)}
-
-
- +
+
+

Activity - -

+ +
-
+
{activities.map((activity, index) => { return ( - - - + ); })}