Skip to content

Commit 1e2ee13

Browse files
committed
Metric containers now rendered through ternary
Charts are now conditionally rendered with a ternary instead of individal truthy checks to increase readablity and dryness of code
1 parent 3b55a6e commit 1e2ee13

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

app/containers/GraphsContainer/GraphsContainer.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,27 @@ const GraphsContainer: React.FC = React.memo(() => {
130130
<TransferColumns />
131131
</div>
132132
)}
133-
{chart.startsWith('health_') && (
133+
{chart.startsWith('health_') ?
134134
<HealthContainer
135135
sizing="solo"
136136
category={chart.substring(7)}
137137
/>
138-
)}
139-
{chart.startsWith('event_') && (
140-
<>
141-
<EventContainer
142-
sizing="solo"
143-
/>
144-
</>
145-
146-
)}
147-
{/* docker charts */}
148-
{chart.startsWith('docker_') && (
149-
<>
138+
:
139+
chart.startsWith('event_') ?
140+
<EventContainer
141+
sizing="solo"
142+
/>
143+
:
144+
chart.startsWith('docker_') ?
145+
150146
<DockerHealthContainer
151147
sizing="solo"
152148
category={chart.substring(7)}
153149
/>
150+
:
151+
<>
154152
</>
155-
156-
)}
153+
}
157154
{chart === 'modifyMetrics' && <ModifyMetrics />}
158155
</div>
159156
)}

0 commit comments

Comments
 (0)