-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Changed the status bar component to an icon based component (#1198
) Co-authored-by: Darshan Simha <[email protected]> Co-authored-by: mshakira <[email protected]>
- Loading branch information
1 parent
13264e3
commit 71c048e
Showing
4 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from "react"; | ||
import { IconsStatusMap } from "../../../utils"; | ||
|
||
import "./style.css"; | ||
export interface StatusCountsProps { | ||
counts: { | ||
healthy: number; | ||
warning: number; | ||
critical: number; | ||
}; | ||
} | ||
|
||
export function StatusCounts(counts: StatusCountsProps) { | ||
return ( | ||
<div className="flex row" style={{ marginLeft: "0.5rem" }}> | ||
{Object.keys(counts.counts).map((key) => { | ||
return ( | ||
<div className="flex row status-block"> | ||
<div className="flex column"> | ||
<div className="flex row"> | ||
<img src={IconsStatusMap[key]} alt={key} /> | ||
<span style={{ marginLeft: "0.5rem" }} className="bold-text"> | ||
: {counts.counts[key]} | ||
</span> | ||
</div> | ||
<div className="flex row title-case regular-text">{key}</div> | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.flex{ | ||
display: flex; | ||
} | ||
.row{ | ||
flex-direction: row; | ||
} | ||
.column{ | ||
flex-direction: column; | ||
} | ||
.status-block{ | ||
align-items: center; | ||
justify-content: center; | ||
flex-grow: 1; | ||
} | ||
.title-case{ | ||
text-transform: capitalize; | ||
} | ||
.regular-text{ | ||
color: #3C4348; | ||
font-size: 12px; | ||
font-weight: 400; | ||
line-height: 23.50px; | ||
word-wrap: break-word | ||
} | ||
.bold-text{ | ||
color: #3C4348; | ||
font-size: 12px; | ||
font-weight: 600; | ||
line-height: 23.50px; | ||
word-wrap: break-word | ||
} | ||
img{ | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.