From d77092665140786fd68c15b3641a68645c799dfa Mon Sep 17 00:00:00 2001
From: Wahyu Kurniawan
Date: Tue, 27 Feb 2024 20:51:29 +0700
Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20feat:=20add=20warning=20er?=
=?UTF-8?q?ror=20icon?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../projects/ProjectCard/ProjectCard.theme.ts | 1 +
.../projects/ProjectCard/ProjectCard.tsx | 51 ++++++++++---------
.../shared/CustomIcon/WarningDiamondIcon.tsx | 19 +++++++
.../src/components/shared/CustomIcon/index.ts | 1 +
4 files changed, 49 insertions(+), 23 deletions(-)
create mode 100644 packages/frontend/src/components/shared/CustomIcon/WarningDiamondIcon.tsx
diff --git a/packages/frontend/src/components/projects/ProjectCard/ProjectCard.theme.ts b/packages/frontend/src/components/projects/ProjectCard/ProjectCard.theme.ts
index 81f0e67c..2443d77b 100644
--- a/packages/frontend/src/components/projects/ProjectCard/ProjectCard.theme.ts
+++ b/packages/frontend/src/components/projects/ProjectCard/ProjectCard.theme.ts
@@ -18,6 +18,7 @@ export const projectCardTheme = tv({
'tracking-[-0.006em]',
],
description: ['text-xs', 'text-elements-low-em'],
+ icons: ['flex', 'items-center', 'gap-1'],
lowerContent: [
'bg-surface-card-hovered',
'px-4',
diff --git a/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx b/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx
index 0ebfd255..85603037 100644
--- a/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx
+++ b/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx
@@ -8,6 +8,7 @@ import {
ClockIcon,
GitHubLogo,
HorizontalDotIcon,
+ WarningDiamondIcon,
} from 'components/shared/CustomIcon';
import { relativeTimeMs } from 'utils/time';
import { Link } from 'react-router-dom';
@@ -29,12 +30,14 @@ export interface ProjectCardProps
export const ProjectCard = ({
className,
project,
- status,
+ status = 'failure',
...props
}: ProjectCardProps) => {
const theme = projectCardTheme();
const hasDeployment = project.deployments.length > 0;
- console.log(project);
+ // TODO: Update this to use the actual status from the API
+ const hasError = status === 'failure';
+
const handleOptionsClick = (
e: MouseEvent,
) => {
@@ -59,27 +62,29 @@ export const ProjectCard = ({
{project.deployments[0]?.domain?.name ?? 'No domain'}
- {/* Dot icon */}
- {/* // TODO: Add popover menu here */}
-
+ {/* Icons */}
+
+ {hasError && }
+
+
{/* Wave */}
diff --git a/packages/frontend/src/components/shared/CustomIcon/WarningDiamondIcon.tsx b/packages/frontend/src/components/shared/CustomIcon/WarningDiamondIcon.tsx
new file mode 100644
index 00000000..cb60f239
--- /dev/null
+++ b/packages/frontend/src/components/shared/CustomIcon/WarningDiamondIcon.tsx
@@ -0,0 +1,19 @@
+import React from 'react';
+import { CustomIcon, CustomIconProps } from './CustomIcon';
+
+export const WarningDiamondIcon = (props: CustomIconProps) => {
+ return (
+
+
+
+ );
+};
diff --git a/packages/frontend/src/components/shared/CustomIcon/index.ts b/packages/frontend/src/components/shared/CustomIcon/index.ts
index ccc6e792..471d8272 100644
--- a/packages/frontend/src/components/shared/CustomIcon/index.ts
+++ b/packages/frontend/src/components/shared/CustomIcon/index.ts
@@ -29,3 +29,4 @@ export * from './BranchIcon';
export * from './GitHubLogo';
export * from './ClockIcon';
export * from './HorizontalDotIcon';
+export * from './WarningDiamondIcon';