GridArea - Make class vars static + change arg obj to getAttributeScale

This commit is contained in:
2018-06-22 18:01:35 +05:30
parent 24bed6c6b1
commit b595ed0ae0
+11 -5
View File
@@ -47,11 +47,11 @@ const GridAreaPropTypes = {
}; };
class GridArea extends PureComponent<GridAreaProps, {}> { class GridArea extends PureComponent<GridAreaProps, {}> {
displayName = 'GridArea'; static displayName = 'GridArea';
propTypes = GridAreaPropTypes; static propTypes = GridAreaPropTypes;
defaultProps = {}; static defaultProps = {};
requiresSVG = true; static requiresSVG = true;
render() { render() {
const { const {
@@ -67,7 +67,13 @@ class GridArea extends PureComponent<GridAreaProps, {}> {
const tickYAttr = isVertical ? 'x' : 'y'; const tickYAttr = isVertical ? 'x' : 'y';
const length = isVertical ? height : width; const length = isVertical ? height : width;
const scale = getAttributeScale(this.props, 'y'); const scale = getAttributeScale({
...this.props,
width,
height,
top,
left
}, 'y');
const values = [[4, 5.76], [8.5, 11.25]]; const values = [[4, 5.76], [8.5, 11.25]];
return ( return (