diff --git a/public/app/core/components/ScrollBar/GrafanaScrollbar.test.tsx b/public/app/core/components/CustomScrollbar/CustomScrollbar.test.tsx
similarity index 63%
rename from public/app/core/components/ScrollBar/GrafanaScrollbar.test.tsx
rename to public/app/core/components/CustomScrollbar/CustomScrollbar.test.tsx
index 7e519acd29d..4edcf7313db 100644
--- a/public/app/core/components/ScrollBar/GrafanaScrollbar.test.tsx
+++ b/public/app/core/components/CustomScrollbar/CustomScrollbar.test.tsx
@@ -1,14 +1,14 @@
import React from 'react';
import renderer from 'react-test-renderer';
-import GrafanaScrollbar from './GrafanaScrollbar';
+import CustomScrollbar from './CustomScrollbar';
-describe('GrafanaScrollbar', () => {
+describe('CustomScrollbar', () => {
it('renders correctly', () => {
const tree = renderer
.create(
-
+
Scrollable content
-
+
)
.toJSON();
expect(tree).toMatchSnapshot();
diff --git a/public/app/core/components/ScrollBar/GrafanaScrollbar.tsx b/public/app/core/components/CustomScrollbar/CustomScrollbar.tsx
similarity index 70%
rename from public/app/core/components/ScrollBar/GrafanaScrollbar.tsx
rename to public/app/core/components/CustomScrollbar/CustomScrollbar.tsx
index 24e5b0d8828..8be65249808 100644
--- a/public/app/core/components/ScrollBar/GrafanaScrollbar.tsx
+++ b/public/app/core/components/CustomScrollbar/CustomScrollbar.tsx
@@ -1,7 +1,7 @@
-import React from 'react';
+import React, { PureComponent } from 'react';
import Scrollbars from 'react-custom-scrollbars';
-interface GrafanaScrollBarProps {
+interface Props {
customClassName?: string;
autoHide?: boolean;
autoHideTimeout?: number;
@@ -9,19 +9,18 @@ interface GrafanaScrollBarProps {
hideTracksWhenNotNeeded?: boolean;
}
-const grafanaScrollBarDefaultProps: Partial = {
- customClassName: 'custom-scrollbars',
- autoHide: true,
- autoHideTimeout: 200,
- autoHideDuration: 200,
- hideTracksWhenNotNeeded: false,
-};
-
/**
* Wraps component into component from `react-custom-scrollbars`
*/
-class GrafanaScrollbar extends React.Component {
- static defaultProps = grafanaScrollBarDefaultProps;
+class CustomScrollbar extends PureComponent {
+
+ static defaultProps: Partial = {
+ customClassName: 'custom-scrollbars',
+ autoHide: true,
+ autoHideTimeout: 200,
+ autoHideDuration: 200,
+ hideTracksWhenNotNeeded: false,
+ };
render() {
const { customClassName, children, ...scrollProps } = this.props;
@@ -45,4 +44,4 @@ class GrafanaScrollbar extends React.Component {
}
}
-export default GrafanaScrollbar;
+export default CustomScrollbar;
diff --git a/public/app/core/components/ScrollBar/__snapshots__/GrafanaScrollbar.test.tsx.snap b/public/app/core/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap
similarity index 96%
rename from public/app/core/components/ScrollBar/__snapshots__/GrafanaScrollbar.test.tsx.snap
rename to public/app/core/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap
index 8e4f51e3587..37d8cea45be 100644
--- a/public/app/core/components/ScrollBar/__snapshots__/GrafanaScrollbar.test.tsx.snap
+++ b/public/app/core/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`GrafanaScrollbar renders correctly 1`] = `
+exports[`CustomScrollbar renders correctly 1`] = `