chore: Removes hard-coded colors - iteration 3 (#20016)

This commit is contained in:
Michael S. Molina
2022-05-11 15:02:13 -03:00
committed by GitHub
parent 3a379af1e7
commit 8bb8b7f612
19 changed files with 342 additions and 345 deletions

View File

@@ -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);

View File

@@ -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 '';
}