mirror of https://github.com/grafana/grafana
parent
d13eebfe52
commit
f7f124c56b
@ -1,9 +1,9 @@ |
||||
import propDeprecationWarning from '../../utils/propDeprecationWarning'; |
||||
import deprecationWarning from '../../utils/deprecationWarning'; |
||||
import { ColorPickerProps } from './ColorPickerPopover'; |
||||
|
||||
export const warnAboutColorPickerPropsDeprecation = (componentName: string, props: ColorPickerProps) => { |
||||
const { onColorChange } = props; |
||||
if (onColorChange) { |
||||
propDeprecationWarning(componentName, 'onColorChange', 'onChange'); |
||||
deprecationWarning(componentName, 'onColorChange', 'onChange'); |
||||
} |
||||
}; |
||||
|
@ -0,0 +1,6 @@ |
||||
const deprecationWarning = (file: string, oldName: string, newName: string) => { |
||||
const message = `[Deprecation warning] ${file}: ${oldName} is deprecated. Use ${newName} instead`; |
||||
console.warn(message); |
||||
}; |
||||
|
||||
export default deprecationWarning; |
@ -1,6 +0,0 @@ |
||||
const propDeprecationWarning = (componentName: string, propName: string, newPropName: string) => { |
||||
const message = `[Deprecation warning] ${componentName}: ${propName} is deprecated. Use ${newPropName} instead`; |
||||
console.warn(message); |
||||
}; |
||||
|
||||
export default propDeprecationWarning; |
Loading…
Reference in new issue