mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
Remove the fixed widths and make it possible to pass it in as a prop instead #13425
This commit is contained in:
parent
77d06a0924
commit
501d974eaa
@ -8,10 +8,10 @@ interface ExtendedOptionProps extends OptionProps<any> {
|
||||
}
|
||||
|
||||
export const Option = (props: ExtendedOptionProps) => {
|
||||
const { children, isSelected, data } = props;
|
||||
const { children, isSelected, data, className } = props;
|
||||
return (
|
||||
<components.Option {...props}>
|
||||
<div className={`description-picker-option__button btn btn-link width-19`}>
|
||||
<div className={`description-picker-option__button btn btn-link ${className}`}>
|
||||
{isSelected && <i className="fa fa-check pull-right" aria-hidden="true" />}
|
||||
<div className="gf-form">{children}</div>
|
||||
<div className="gf-form">
|
||||
|
@ -7,10 +7,10 @@ export interface Props {
|
||||
}
|
||||
|
||||
export const PickerOption = (props: OptionProps<any>) => {
|
||||
const { children } = props;
|
||||
const { children, className } = props;
|
||||
return (
|
||||
<components.Option {...props}>
|
||||
<div className={`description-picker-option__button btn btn-link width-19`}>{children}</div>
|
||||
<div className={`description-picker-option__button btn btn-link ${className}`}>{children}</div>
|
||||
</components.Option>
|
||||
);
|
||||
};
|
||||
|
@ -8,10 +8,10 @@ interface ExtendedOptionProps extends OptionProps<any> {
|
||||
}
|
||||
|
||||
export const PickerOption = (props: ExtendedOptionProps) => {
|
||||
const { children, data } = props;
|
||||
const { children, data, className } = props;
|
||||
return (
|
||||
<components.Option {...props}>
|
||||
<div className={`description-picker-option__button btn btn-link width-19`}>
|
||||
<div className={`description-picker-option__button btn btn-link ${className}`}>
|
||||
{data.avatarUrl && <img src={data.avatarUrl} alt={data.label} className="user-picker-option__avatar" />}
|
||||
{children}
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`PickerOption renders correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
className="description-picker-option__button btn btn-link width-19"
|
||||
className="description-picker-option__button btn btn-link"
|
||||
>
|
||||
<img
|
||||
alt="User picker label"
|
||||
|
Loading…
Reference in New Issue
Block a user