Spaces:
Runtime error
Runtime error
Update src/components/monitor/monitor.jsx
Browse files
src/components/monitor/monitor.jsx
CHANGED
|
@@ -54,7 +54,9 @@ const MonitorComponent = props => (
|
|
| 54 |
data-opcode={props.opcode}
|
| 55 |
>
|
| 56 |
{React.createElement(modes[props.mode], {
|
| 57 |
-
categoryColor: categories[props.category],
|
|
|
|
|
|
|
| 58 |
...props
|
| 59 |
})}
|
| 60 |
</Box>
|
|
@@ -133,6 +135,10 @@ const monitorModes = Object.keys(modes);
|
|
| 133 |
|
| 134 |
MonitorComponent.propTypes = {
|
| 135 |
category: PropTypes.oneOf(Object.keys(categories)),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
componentRef: PropTypes.func.isRequired,
|
| 137 |
draggable: PropTypes.bool.isRequired,
|
| 138 |
id: PropTypes.string.isRequired,
|
|
|
|
| 54 |
data-opcode={props.opcode}
|
| 55 |
>
|
| 56 |
{React.createElement(modes[props.mode], {
|
| 57 |
+
categoryColor: categories[props.category] ?? props.category,
|
| 58 |
+
// Either get the color by category, or assume the passed category
|
| 59 |
+
// is a valid color.
|
| 60 |
...props
|
| 61 |
})}
|
| 62 |
</Box>
|
|
|
|
| 135 |
|
| 136 |
MonitorComponent.propTypes = {
|
| 137 |
category: PropTypes.oneOf(Object.keys(categories)),
|
| 138 |
+
category: PropTypes.oneOf([
|
| 139 |
+
PropTypes.string,
|
| 140 |
+
...Object.keys(categories)
|
| 141 |
+
]),
|
| 142 |
componentRef: PropTypes.func.isRequired,
|
| 143 |
draggable: PropTypes.bool.isRequired,
|
| 144 |
id: PropTypes.string.isRequired,
|