From c427f288caf477cb4153026748ced7cf091dd041 Mon Sep 17 00:00:00 2001 From: chadstewart Date: Fri, 2 Sep 2022 16:21:54 -0500 Subject: [PATCH 1/3] Updated padding of top nav to fix issue with right element not getting padding. --- components/molecules/HeaderLogo/header-logo.tsx | 4 ++-- components/organisms/TopNav/top-nav.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/molecules/HeaderLogo/header-logo.tsx b/components/molecules/HeaderLogo/header-logo.tsx index 5c72d9d2d2..2f21ef094e 100644 --- a/components/molecules/HeaderLogo/header-logo.tsx +++ b/components/molecules/HeaderLogo/header-logo.tsx @@ -12,7 +12,7 @@ interface HeaderLogoProps { const HeaderLogo: React.FC = ({ loginScreen, withBg = false }) => { return ( -
+
Open Sauced Logo = ({ loginScreen, withBg = false }) src={withBg ? openSaucedImgWithBg : openSaucedImg} /> diff --git a/components/organisms/TopNav/top-nav.tsx b/components/organisms/TopNav/top-nav.tsx index 4f144cc7dc..2e437edca9 100644 --- a/components/organisms/TopNav/top-nav.tsx +++ b/components/organisms/TopNav/top-nav.tsx @@ -5,7 +5,7 @@ import HeaderLogo from "../../molecules/HeaderLogo/header-logo"; const TopNav: React.FC = () => { return ( -
+
From 7913e6c62463954935801d176899d84f01c3cdf5 Mon Sep 17 00:00:00 2001 From: chadstewart Date: Fri, 2 Sep 2022 16:29:05 -0500 Subject: [PATCH 2/3] Replaces div with Card component in highlight card comopnent. --- components/atoms/Card/card.tsx | 2 +- .../HighlightCard/highlight-card.tsx | 101 +++++++++--------- 2 files changed, 53 insertions(+), 50 deletions(-) diff --git a/components/atoms/Card/card.tsx b/components/atoms/Card/card.tsx index 43f349c92c..0816fb75bd 100644 --- a/components/atoms/Card/card.tsx +++ b/components/atoms/Card/card.tsx @@ -8,7 +8,7 @@ interface CardProps { const Card: React.FC = ({ className, children, heading }) => { return ( -
+
{ heading ? <> diff --git a/components/molecules/HighlightCard/highlight-card.tsx b/components/molecules/HighlightCard/highlight-card.tsx index c7096070d2..21b464cef0 100644 --- a/components/molecules/HighlightCard/highlight-card.tsx +++ b/components/molecules/HighlightCard/highlight-card.tsx @@ -6,6 +6,7 @@ import labelIcon from "../../../public/icons/icon-label--blue.svg"; import thumbsIcon from "../../../public/icons/icon-thumbs-down--yellow.svg"; import metricArrow from "../../../public/icons/metric-arrow.svg"; import Link from "next/link"; +import Card from "components/atoms/Card/card"; interface HighlightCardProps { className?: string; @@ -45,63 +46,65 @@ const HighlightCard: React.FC = ({ className, label, icon, m return ( -
- {/* Top Information */} -
- {/* Label */} -
- {/* Label: Icon */} -
- {icon -
- {/* Label: Text */} -
- { label ? label : "Label" } + + <> + {/* Top Information */} +
+ {/* Label */} +
+ {/* Label: Icon */} +
+ {icon +
+ {/* Label: Text */} +
+ { label ? label : "Label" } +
-
- {/* Last Updated Information */} -
- {/* Last Updated: Number */} -
- { numChanged ? numChanged : 0 } + {/* Last Updated Information */} +
+ {/* Last Updated: Number */} +
+ { numChanged ? numChanged : 0 } +
+ {/* Last Updated: Icon */} + {(increased
- {/* Last Updated: Icon */} - {(increased
-
- {/* Main Information */} -
- {/* Main Number */} -
- {/* Percentage */} -
- { percentage ? percentage : 0 }% -
- - {/* Label */} -
- { percentageLabel ? percentageLabel : "Label"} + {/* Main Information */} +
+ {/* Main Number */} +
+ {/* Percentage */} +
+ { percentage ? percentage : 0 }% +
+ + {/* Label */} +
+ { percentageLabel ? percentageLabel : "Label"} +
-
- {/* Progress Bar */} -
0 || percentage < 99)) ? "gap-2" : ""}`}> -
70 ? "bg-green-500" : percentage && percentage > 30 ? "bg-yellow-500" : "bg-red-500") : (percentage && percentage > 70 ? "bg-red-500" : percentage && percentage > 30 ? "bg-yellow-500" : "bg-green-500")} h-3 rounded-full transition-all duration-500 ease-in-out`} - style={{width: (percentage ? percentage : 0) + "%"}}>
- -
+ {/* Progress Bar */} +
0 || percentage < 99)) ? "gap-2" : ""}`}> +
70 ? "bg-green-500" : percentage && percentage > 30 ? "bg-yellow-500" : "bg-red-500") : (percentage && percentage > 70 ? "bg-red-500" : percentage && percentage > 30 ? "bg-yellow-500" : "bg-green-500")} h-3 rounded-full transition-all duration-500 ease-in-out`} + style={{width: (percentage ? percentage : 0) + "%"}}>
+ +
+
-
-
+ + ); }; From 43d2da44464266807528fa453f59c32fa664f9ff Mon Sep 17 00:00:00 2001 From: chadstewart Date: Fri, 2 Sep 2022 18:08:49 -0500 Subject: [PATCH 3/3] Updated code in highlight card to be a cleaner implementation. --- .../HighlightCard/highlight-card.tsx | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/components/molecules/HighlightCard/highlight-card.tsx b/components/molecules/HighlightCard/highlight-card.tsx index 21b464cef0..54040d0599 100644 --- a/components/molecules/HighlightCard/highlight-card.tsx +++ b/components/molecules/HighlightCard/highlight-card.tsx @@ -24,21 +24,25 @@ interface HighlightCardProps { // Replace these icons, or make them dynamic. // Maybe create an Icon component. const icons = { - participation: { + "participation": { src: repoIcon.src, - label: "Participation" + label: "Participation", + color: "bg-blue-100" }, - acceptedPR: { + "accepted-pr": { src: prIcon.src, - label: "Accepted PRs" + label: "Accepted PRs", + color: "bg-green-100" }, - unlabeledPR: { + "unlabeled-pr": { src: labelIcon.src, - label: "Unlabeled PRs" + label: "Unlabeled PRs", + color: "bg-cyan-100" }, - spam: { + "spam": { src: thumbsIcon.src, - label: "Spam" + label: "Spam", + color: "bg-orange-100" } }; @@ -53,11 +57,11 @@ const HighlightCard: React.FC = ({ className, label, icon, m {/* Label */}
{/* Label: Icon */} -
+
{icon + alt={icon ? icons[icon].label : "Icon"} + src={icon ? icons[icon].src : "Icon"} />
{/* Label: Text */}