⚡️ feat: add warning error icon
This commit is contained in:
parent
e46544cfd3
commit
d770926651
@ -18,6 +18,7 @@ export const projectCardTheme = tv({
|
|||||||
'tracking-[-0.006em]',
|
'tracking-[-0.006em]',
|
||||||
],
|
],
|
||||||
description: ['text-xs', 'text-elements-low-em'],
|
description: ['text-xs', 'text-elements-low-em'],
|
||||||
|
icons: ['flex', 'items-center', 'gap-1'],
|
||||||
lowerContent: [
|
lowerContent: [
|
||||||
'bg-surface-card-hovered',
|
'bg-surface-card-hovered',
|
||||||
'px-4',
|
'px-4',
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
ClockIcon,
|
ClockIcon,
|
||||||
GitHubLogo,
|
GitHubLogo,
|
||||||
HorizontalDotIcon,
|
HorizontalDotIcon,
|
||||||
|
WarningDiamondIcon,
|
||||||
} from 'components/shared/CustomIcon';
|
} from 'components/shared/CustomIcon';
|
||||||
import { relativeTimeMs } from 'utils/time';
|
import { relativeTimeMs } from 'utils/time';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
@ -29,12 +30,14 @@ export interface ProjectCardProps
|
|||||||
export const ProjectCard = ({
|
export const ProjectCard = ({
|
||||||
className,
|
className,
|
||||||
project,
|
project,
|
||||||
status,
|
status = 'failure',
|
||||||
...props
|
...props
|
||||||
}: ProjectCardProps) => {
|
}: ProjectCardProps) => {
|
||||||
const theme = projectCardTheme();
|
const theme = projectCardTheme();
|
||||||
const hasDeployment = project.deployments.length > 0;
|
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 = (
|
const handleOptionsClick = (
|
||||||
e: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>,
|
e: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>,
|
||||||
) => {
|
) => {
|
||||||
@ -59,8 +62,9 @@ export const ProjectCard = ({
|
|||||||
{project.deployments[0]?.domain?.name ?? 'No domain'}
|
{project.deployments[0]?.domain?.name ?? 'No domain'}
|
||||||
</p>
|
</p>
|
||||||
</Link>
|
</Link>
|
||||||
{/* Dot icon */}
|
{/* Icons */}
|
||||||
{/* // TODO: Add popover menu here */}
|
<div className={theme.icons()}>
|
||||||
|
{hasError && <WarningDiamondIcon className="text-elements-danger" />}
|
||||||
<Menu placement="bottom-end">
|
<Menu placement="bottom-end">
|
||||||
<MenuHandler>
|
<MenuHandler>
|
||||||
<Button
|
<Button
|
||||||
@ -81,6 +85,7 @@ export const ProjectCard = ({
|
|||||||
</MenuList>
|
</MenuList>
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{/* Wave */}
|
{/* Wave */}
|
||||||
<WavyBorder />
|
<WavyBorder />
|
||||||
{/* Lower content */}
|
{/* Lower content */}
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { CustomIcon, CustomIconProps } from './CustomIcon';
|
||||||
|
|
||||||
|
export const WarningDiamondIcon = (props: CustomIconProps) => {
|
||||||
|
return (
|
||||||
|
<CustomIcon
|
||||||
|
width="20"
|
||||||
|
height="20"
|
||||||
|
viewBox="0 0 20 20"
|
||||||
|
fill="none"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M18.3851 9.11879L10.8812 1.6141C10.647 1.38129 10.3302 1.25061 9.99999 1.25061C9.66976 1.25061 9.35294 1.38129 9.11874 1.6141L1.61874 9.11879C1.38593 9.35299 1.25525 9.66981 1.25525 10C1.25525 10.3303 1.38593 10.6471 1.61874 10.8813L9.12265 18.386C9.35685 18.6188 9.67367 18.7495 10.0039 18.7495C10.3341 18.7495 10.6509 18.6188 10.8851 18.386L18.3891 10.8813C18.6219 10.6471 18.7525 10.3303 18.7525 10C18.7525 9.66981 18.6219 9.35299 18.3891 9.11879H18.3851ZM9.37499 6.25004C9.37499 6.08428 9.44084 5.92531 9.55805 5.8081C9.67526 5.69089 9.83423 5.62504 9.99999 5.62504C10.1658 5.62504 10.3247 5.69089 10.4419 5.8081C10.5591 5.92531 10.625 6.08428 10.625 6.25004V10.625C10.625 10.7908 10.5591 10.9498 10.4419 11.067C10.3247 11.1842 10.1658 11.25 9.99999 11.25C9.83423 11.25 9.67526 11.1842 9.55805 11.067C9.44084 10.9498 9.37499 10.7908 9.37499 10.625V6.25004ZM9.99999 14.375C9.81457 14.375 9.63332 14.3201 9.47914 14.217C9.32497 14.114 9.20481 13.9676 9.13385 13.7963C9.0629 13.625 9.04433 13.4365 9.0805 13.2546C9.11668 13.0728 9.20597 12.9057 9.33708 12.7746C9.46819 12.6435 9.63524 12.5542 9.81709 12.5181C9.99895 12.4819 10.1875 12.5004 10.3588 12.5714C10.5301 12.6424 10.6765 12.7625 10.7795 12.9167C10.8825 13.0709 10.9375 13.2521 10.9375 13.4375C10.9375 13.6862 10.8387 13.9246 10.6629 14.1005C10.4871 14.2763 10.2486 14.375 9.99999 14.375Z"
|
||||||
|
fill="currentColor"
|
||||||
|
/>
|
||||||
|
</CustomIcon>
|
||||||
|
);
|
||||||
|
};
|
@ -29,3 +29,4 @@ export * from './BranchIcon';
|
|||||||
export * from './GitHubLogo';
|
export * from './GitHubLogo';
|
||||||
export * from './ClockIcon';
|
export * from './ClockIcon';
|
||||||
export * from './HorizontalDotIcon';
|
export * from './HorizontalDotIcon';
|
||||||
|
export * from './WarningDiamondIcon';
|
||||||
|
Loading…
Reference in New Issue
Block a user