mirror of
https://github.com/apache/superset.git
synced 2026-06-01 05:39:17 +00:00
chore: Removes hard-coded colors - iteration 3 (#20016)
This commit is contained in:
committed by
GitHub
parent
3a379af1e7
commit
8bb8b7f612
@@ -27,6 +27,7 @@ import {
|
||||
getChartMetadataRegistry,
|
||||
validateNonEmpty,
|
||||
isValidExpression,
|
||||
withTheme,
|
||||
} from '@superset-ui/core';
|
||||
|
||||
import SelectControl from 'src/explore/components/controls/SelectControl';
|
||||
@@ -97,7 +98,7 @@ const defaultProps = {
|
||||
close: () => {},
|
||||
};
|
||||
|
||||
export default class AnnotationLayer extends React.PureComponent {
|
||||
class AnnotationLayer extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const {
|
||||
@@ -710,7 +711,9 @@ export default class AnnotationLayer extends React.PureComponent {
|
||||
return (
|
||||
<>
|
||||
{this.props.error && (
|
||||
<span style={{ color: 'red' }}>ERROR: {this.props.error}</span>
|
||||
<span style={{ color: this.props.theme.colors.error.base }}>
|
||||
ERROR: {this.props.error}
|
||||
</span>
|
||||
)}
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{ marginRight: '2rem' }}>
|
||||
@@ -807,3 +810,5 @@ export default class AnnotationLayer extends React.PureComponent {
|
||||
|
||||
AnnotationLayer.propTypes = propTypes;
|
||||
AnnotationLayer.defaultProps = defaultProps;
|
||||
|
||||
export default withTheme(AnnotationLayer);
|
||||
|
||||
@@ -141,10 +141,14 @@ class AnnotationLayerControl extends React.PureComponent {
|
||||
}
|
||||
|
||||
renderInfo(anno) {
|
||||
const { annotationError, annotationQuery } = this.props;
|
||||
const { annotationError, annotationQuery, theme } = this.props;
|
||||
if (annotationQuery[anno.name]) {
|
||||
return (
|
||||
<i className="fa fa-refresh" style={{ color: 'orange' }} aria-hidden />
|
||||
<i
|
||||
className="fa fa-refresh"
|
||||
style={{ color: theme.colors.primary.base }}
|
||||
aria-hidden
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (annotationError[anno.name]) {
|
||||
@@ -157,7 +161,7 @@ class AnnotationLayerControl extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
if (!anno.show) {
|
||||
return <span style={{ color: 'red' }}> Hidden </span>;
|
||||
return <span style={{ color: theme.colors.error.base }}> Hidden </span>;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user