Skip to content

Commit dd8f354

Browse files
committed
fix: show two columns, when the other one is empty
fix: show two columns when no none headline properties chore: remove console.log chore: update spacing fix: show two property columns when no analytics fix: fix issues with cards styling fix: scroll issues fix: refactor and re-sort components statuses chore: remove console logs
1 parent 9376740 commit dd8f354

File tree

11 files changed

+586
-382
lines changed

11 files changed

+586
-382
lines changed

src/components/Canary/HealthChecksSummary.tsx

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/components/Incidents/IncidentCardSummary/index.tsx

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/components/StatusLine/StatusLine.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ export type StatusLineData = {
2020

2121
export type StatusLineProps = React.HTMLProps<HTMLDivElement> & StatusLineData;
2222

23-
const renderIcon = (icon: string | React.ReactNode) => {
23+
interface RenderIconProps {
24+
icon: string | React.ReactNode;
25+
}
26+
27+
const RenderIcon: React.FC<RenderIconProps> = ({ icon }) => {
2428
if (!icon) {
2529
return null;
2630
}
2731
if (typeof icon === "object") {
28-
return icon;
32+
// eslint-disable-next-line react/jsx-no-useless-fragment
33+
return <>{icon}</>;
2934
} else if (typeof icon === "string") {
30-
return <Icon name={icon} className="h-4 w-4" />;
35+
return <Icon name={icon} className="h-4 w-4 min-w-max" />;
3136
}
37+
return null;
3238
};
3339

3440
const StatusInfoEntry = ({
@@ -46,14 +52,14 @@ const StatusInfoEntry = ({
4652
to={statusInfo.url}
4753
target={target || ""}
4854
>
49-
{statusInfo.icon && renderIcon(statusInfo.icon)}
55+
{statusInfo.icon && <RenderIcon icon={statusInfo.icon} />}
5056
<Chip text={statusInfo.label} color={statusInfo.color} />
5157
</Link>
5258
);
5359
} else {
5460
return (
5561
<span className="inline-flex cursor-pointer space-x-1">
56-
{statusInfo.icon && renderIcon(statusInfo.icon)}
62+
{statusInfo.icon && <RenderIcon icon={statusInfo.icon} />}
5763
<Chip text={statusInfo.label} color={statusInfo.color} />
5864
</span>
5965
);
@@ -74,7 +80,7 @@ export function StatusLine({
7480
className={clsx("flex flex-row items-center space-x-1", className)}
7581
{...rest}
7682
>
77-
{icon && renderIcon(icon)}
83+
{icon && <RenderIcon icon={icon} />}
7884
{url && (
7985
<Link
8086
title={label}

src/components/Topology/TopologyCard/CardMetrics.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export const CardMetrics = ({
2424
labelClasses = "text-gray-600 font-semibold text-xs mb-0.5",
2525
metricsClasses = "font-bold text-xs leading-1.21rel flex flex-center justify-center"
2626
}: IProps) => {
27+
if (!items || items.length === 0) {
28+
return null;
29+
}
30+
2731
return (
2832
<div className="flex flex-1 items-center justify-between divide-x rounded-b-8px">
2933
{items.map((item) => (

src/components/Topology/TopologyCard/Property.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export function PropertyDisplay({
1414
className = "",
1515
...props
1616
}: PropertyDisplayProps) {
17-
console.log("property display", property);
1817
const { name, icon, color } = property;
1918
const label =
2019
NodePodPropToLabelMap[name as keyof typeof NodePodPropToLabelMap] || name;

0 commit comments

Comments
 (0)