Skip to content

Commit

Permalink
feat(#77): add neutral circle when no error or success
Browse files Browse the repository at this point in the history
  • Loading branch information
mari1912 committed Jul 17, 2024
1 parent 0077b0e commit 3d1aa1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dashboard/src/components/ColoredCircle/ColoredCircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ const ColoredCircle = ({
className,
}: IColoredCircle): JSX.Element => {
const backgroundColor =
type === ItemType.Error ? 'bg-lightRed' : 'bg-lightGreen';
type === ItemType.Error
? 'bg-lightRed'
: type === ItemType.Success
? 'bg-lightGreen'
: 'bg-mediumGray';
return (
<div
className={classNames(
Expand Down
9 changes: 9 additions & 0 deletions dashboard/src/components/ListingItem/ListingItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export enum ItemType {
Warning,
Error,
Success,
None,
}

const ListingItem = ({
Expand All @@ -38,6 +39,13 @@ const ListingItem = ({
<></>
);

const itemNeutral =
!errors || errors === 0 || !success || success === 0 ? (
<ColoredCircle quantity={0} type={ItemType.None} />
) : (
<></>
);

const itemSuccess =
success && success > 0 ? (
<ColoredCircle quantity={success} type={ItemType.Success} />
Expand All @@ -50,6 +58,7 @@ const ListingItem = ({
{itemError}
{itemWarning}
{itemSuccess}
{itemNeutral}
<span className="text-black text-sm">{text}</span>
</div>
);
Expand Down

0 comments on commit 3d1aa1a

Please sign in to comment.