Skip to content

Commit 1fa098a

Browse files
committed
feat(explorer): add cardano network in status row
In the 'epoch ###' card, below the eras.
1 parent e7f15cc commit 1fa098a

File tree

1 file changed

+7
-10
lines changed
  • mithril-explorer/src/components/ControlPanel/AggregatorStatus

1 file changed

+7
-10
lines changed

mithril-explorer/src/components/ControlPanel/AggregatorStatus/index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ function InfoGroupCard({ children, title, ...props }) {
3131
);
3232
}
3333

34-
function InfoRow({ label, children, ...props }) {
34+
function InfoRow({ label, children, className, ...props }) {
3535
return (
3636
<>
37-
<div className="d-flex justify-content-between" {...props}>
37+
<div className={`d-flex justify-content-between ${className}`} {...props}>
3838
<div className="me-2 flex-fill">
3939
<em>{label}:</em>
4040
</div>
@@ -120,10 +120,6 @@ export default function AggregatorStatus({ showContent = true }) {
120120
return ((value / total) * 100).toFixed(0);
121121
}
122122

123-
function capitalizeFirstLetter(string) {
124-
return string.charAt(0).toUpperCase() + string.slice(1);
125-
}
126-
127123
return fallbackToEpochSetting ? (
128124
<Stack direction="horizontal">
129125
<Collapse in={showContent}>
@@ -138,11 +134,12 @@ export default function AggregatorStatus({ showContent = true }) {
138134
<div id="contentRow">
139135
<Row className="d-flex flex-wrap justify-content-md-center">
140136
<InfoGroupCard title={`Epoch ${aggregatorStatus.epoch}`}>
137+
<InfoRow label="Cardano Network" className="text-capitalize">
138+
{aggregatorStatus.cardano_network}
139+
</InfoRow>
141140
<InfoRow label="Cardano Era">{aggregatorStatus.cardano_era}</InfoRow>
142-
<InfoRow label="Mithril Era">
143-
{aggregatorStatus.mithril_era
144-
? capitalizeFirstLetter(aggregatorStatus.mithril_era)
145-
: ""}
141+
<InfoRow label="Mithril Era" className="text-capitalize">
142+
{aggregatorStatus.mithril_era}
146143
</InfoRow>
147144
</InfoGroupCard>
148145

0 commit comments

Comments
 (0)