Commit 12336e15 by Peter Holmberg

using label component

parent 70f6100d
......@@ -5,11 +5,12 @@ interface Props {
tooltip?: string;
for?: string;
children: ReactNode;
width?: number;
}
export const Label: SFC<Props> = props => {
return (
<span className="gf-form-label width-10">
<span className={`gf-form-label width-${props.width ? props.width : '10'}`}>
<span>{props.children}</span>
{props.tooltip && (
<Tooltip className="gf-form-help-icon--right-normal" placement="auto" content={props.tooltip}>
......@@ -19,4 +20,3 @@ export const Label: SFC<Props> = props => {
</span>
);
};
import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import Tooltip from '../../core/components/Tooltip/Tooltip';
import { Label } from '../../core/components/Label/Label';
import SimplePicker from '../../core/components/Picker/SimplePicker';
import { Dashboard, OrganizationPreferences } from 'app/types';
import {
......@@ -59,16 +59,12 @@ export class OrgPreferences extends PureComponent<Props> {
/>
</div>
<div className="gf-form">
<span className="gf-form-label width-11">
<Label
width={11}
tooltip="Not finding dashboard you want? Star it first, then it should appear in this select box."
>
Home Dashboard
<Tooltip
className="gf-form-help-icon gf-form-help-icon--right-normal"
placement="right"
content="Not finding dashboard you want? Star it first, then it should appear in this select box."
>
<i className="fa fa-info-circle" />
</Tooltip>
</span>
</Label>
<SimplePicker
defaultValue={starredDashboards.find(dashboard => dashboard.id === preferences.homeDashboardId)}
getOptionValue={i => i.id}
......
......@@ -44,20 +44,12 @@ exports[`Render should render component 1`] = `
<div
className="gf-form"
>
<span
className="gf-form-label width-11"
<Component
tooltip="Not finding dashboard you want? Star it first, then it should appear in this select box."
width={11}
>
Home Dashboard
<class_1
className="gf-form-help-icon gf-form-help-icon--right-normal"
content="Not finding dashboard you want? Star it first, then it should appear in this select box."
placement="right"
>
<i
className="fa fa-info-circle"
/>
</class_1>
</span>
</Component>
<SimplePicker
defaultValue={
Object {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment