diff --git a/src/components/editors/ThresholdsEditor.tsx b/src/components/editors/ThresholdsEditor.tsx index 3b0a8c8..08bd027 100644 --- a/src/components/editors/ThresholdsEditor.tsx +++ b/src/components/editors/ThresholdsEditor.tsx @@ -1,6 +1,6 @@ import { FieldNamePicker } from '../../grafana/MatchersUI/FieldNamePicker'; -import { StandardEditorProps } from '@grafana/data'; +import { GrafanaTheme, StandardEditorProps } from '@grafana/data'; import { Button, ColorPicker, @@ -9,11 +9,13 @@ import { InlineField, InlineSwitch, Input, + stylesFactory, ThemeContext, } from '@grafana/ui'; import React from 'react'; +import { css } from 'emotion'; import * as _ from 'lodash'; interface Props { @@ -65,11 +67,12 @@ export function ThresholdsEditor({ onChange, value, context }: StandardEditorPro return ( - {() => { - // const styles = getStyles(theme.v1); + {(theme) => { + const styles = getStyles(theme.v1); return (
{config.thresholds.map((threshold, thresholdIdx) => { return ( - + ); } + +interface ThresholdsEditorStyles { + row: string; +} + +const getStyles = stylesFactory((theme: GrafanaTheme): ThresholdsEditorStyles => { + return { + row: css` + margin-bottom: ${theme.spacing.sm}; + `, + }; +});