Skip to content

Commit 76bc07f

Browse files
committed
Shrink indent_size / tabWidth
1 parent 546f225 commit 76bc07f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1386
-1406
lines changed

Diff for: .editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ root = true
88
charset = utf-8
99
end_of_line = lf
1010
indent_style = space
11-
indent_size = 4
11+
indent_size = 2
1212
trim_trailing_whitespace = true
1313
insert_final_newline = true

Diff for: .prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"trailingComma": "all",
3-
"tabWidth": 4
3+
"tabWidth": 2
44
}

Diff for: elements/Circle.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
44
import Shape from "./Shape";
55

66
export default class Circle extends Shape {
7-
static displayName = "Circle";
7+
static displayName = "Circle";
88

9-
static defaultProps = {
10-
cx: 0,
11-
cy: 0,
12-
r: 0,
13-
};
9+
static defaultProps = {
10+
cx: 0,
11+
cy: 0,
12+
r: 0,
13+
};
1414

15-
render() {
16-
const { props } = this;
17-
const { cx, cy, r } = props;
18-
return (
19-
<RNSVGCircle
20-
ref={this.refMethod}
21-
{...extractProps(propsAndStyles(props), this)}
22-
cx={cx}
23-
cy={cy}
24-
r={r}
25-
/>
26-
);
27-
}
15+
render() {
16+
const { props } = this;
17+
const { cx, cy, r } = props;
18+
return (
19+
<RNSVGCircle
20+
ref={this.refMethod}
21+
{...extractProps(propsAndStyles(props), this)}
22+
cx={cx}
23+
cy={cy}
24+
r={r}
25+
/>
26+
);
27+
}
2828
}
2929

3030
const RNSVGCircle = requireNativeComponent("RNSVGCircle");

Diff for: elements/ClipPath.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import extractClipPath from "../lib/extract/extractClipPath";
44
import Shape from "./Shape";
55

66
export default class ClipPath extends Shape {
7-
static displayName = "ClipPath";
7+
static displayName = "ClipPath";
88

9-
render() {
10-
const { id, children } = this.props;
11-
return (
12-
<RNSVGClipPath
13-
ref={this.refMethod}
14-
name={id}
15-
{...extractClipPath(this.props)}
16-
>
17-
{children}
18-
</RNSVGClipPath>
19-
);
20-
}
9+
render() {
10+
const { id, children } = this.props;
11+
return (
12+
<RNSVGClipPath
13+
ref={this.refMethod}
14+
name={id}
15+
{...extractClipPath(this.props)}
16+
>
17+
{children}
18+
</RNSVGClipPath>
19+
);
20+
}
2121
}
2222

2323
const RNSVGClipPath = requireNativeComponent("RNSVGClipPath");

Diff for: elements/Defs.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React, { Component } from "react";
22
import { requireNativeComponent } from "react-native";
33

44
export default class Defs extends Component {
5-
static displayName = "Defs";
5+
static displayName = "Defs";
66

7-
render() {
8-
return <RNSVGDefs>{this.props.children}</RNSVGDefs>;
9-
}
7+
render() {
8+
return <RNSVGDefs>{this.props.children}</RNSVGDefs>;
9+
}
1010
}
1111

1212
const RNSVGDefs = requireNativeComponent("RNSVGDefs");

Diff for: elements/Ellipse.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
44
import Shape from "./Shape";
55

66
export default class Ellipse extends Shape {
7-
static displayName = "Ellipse";
7+
static displayName = "Ellipse";
88

9-
static defaultProps = {
10-
cx: 0,
11-
cy: 0,
12-
rx: 0,
13-
ry: 0,
14-
};
9+
static defaultProps = {
10+
cx: 0,
11+
cy: 0,
12+
rx: 0,
13+
ry: 0,
14+
};
1515

16-
render() {
17-
const { props } = this;
18-
const { cx, cy, rx, ry } = props;
19-
return (
20-
<RNSVGEllipse
21-
ref={this.refMethod}
22-
{...extractProps(propsAndStyles(props), this)}
23-
cx={cx}
24-
cy={cy}
25-
rx={rx}
26-
ry={ry}
27-
/>
28-
);
29-
}
16+
render() {
17+
const { props } = this;
18+
const { cx, cy, rx, ry } = props;
19+
return (
20+
<RNSVGEllipse
21+
ref={this.refMethod}
22+
{...extractProps(propsAndStyles(props), this)}
23+
cx={cx}
24+
cy={cy}
25+
rx={rx}
26+
ry={ry}
27+
/>
28+
);
29+
}
3030
}
3131

3232
const RNSVGEllipse = requireNativeComponent("RNSVGEllipse");

Diff for: elements/G.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ import extractTransform from "../lib/extract/extractTransform";
66
import Shape from "./Shape";
77

88
export default class G extends Shape {
9-
static displayName = "G";
9+
static displayName = "G";
1010

11-
setNativeProps = props => {
12-
const matrix = !props.matrix && extractTransform(props);
13-
if (matrix) {
14-
props.matrix = matrix;
15-
}
16-
this.root.setNativeProps(props);
17-
};
18-
19-
render() {
20-
const { props } = this;
21-
const prop = propsAndStyles(props);
22-
return (
23-
<RNSVGGroup
24-
ref={this.refMethod}
25-
{...extractProps(prop, this)}
26-
font={extractFont(prop)}
27-
>
28-
{props.children}
29-
</RNSVGGroup>
30-
);
11+
setNativeProps = props => {
12+
const matrix = !props.matrix && extractTransform(props);
13+
if (matrix) {
14+
props.matrix = matrix;
3115
}
16+
this.root.setNativeProps(props);
17+
};
18+
19+
render() {
20+
const { props } = this;
21+
const prop = propsAndStyles(props);
22+
return (
23+
<RNSVGGroup
24+
ref={this.refMethod}
25+
{...extractProps(prop, this)}
26+
font={extractFont(prop)}
27+
>
28+
{props.children}
29+
</RNSVGGroup>
30+
);
31+
}
3232
}
3333

3434
const RNSVGGroup = requireNativeComponent("RNSVGGroup");

Diff for: elements/Image.js

+34-37
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,42 @@ import Shape from "./Shape";
77
const spacesRegExp = /\s+/;
88

99
export default class SvgImage extends Shape {
10-
static displayName = "Image";
10+
static displayName = "Image";
1111

12-
static defaultProps = {
13-
x: 0,
14-
y: 0,
15-
width: 0,
16-
height: 0,
17-
preserveAspectRatio: "xMidYMid meet",
18-
};
12+
static defaultProps = {
13+
x: 0,
14+
y: 0,
15+
width: 0,
16+
height: 0,
17+
preserveAspectRatio: "xMidYMid meet",
18+
};
1919

20-
render() {
21-
const { props } = this;
22-
const {
23-
preserveAspectRatio,
24-
x,
25-
y,
26-
width,
27-
height,
28-
xlinkHref,
29-
href = xlinkHref,
30-
} = props;
31-
const modes = preserveAspectRatio.trim().split(spacesRegExp);
32-
return (
33-
<RNSVGImage
34-
ref={this.refMethod}
35-
{...extractProps(
36-
{ ...propsAndStyles(props), x: null, y: null },
37-
this,
38-
)}
39-
x={x}
40-
y={y}
41-
width={width}
42-
height={height}
43-
meetOrSlice={meetOrSliceTypes[modes[1]] || 0}
44-
align={alignEnum[modes[0]] || "xMidYMid"}
45-
src={Image.resolveAssetSource(href)}
46-
/>
47-
);
48-
}
20+
render() {
21+
const { props } = this;
22+
const {
23+
preserveAspectRatio,
24+
x,
25+
y,
26+
width,
27+
height,
28+
xlinkHref,
29+
href = xlinkHref,
30+
} = props;
31+
const modes = preserveAspectRatio.trim().split(spacesRegExp);
32+
return (
33+
<RNSVGImage
34+
ref={this.refMethod}
35+
{...extractProps({ ...propsAndStyles(props), x: null, y: null }, this)}
36+
x={x}
37+
y={y}
38+
width={width}
39+
height={height}
40+
meetOrSlice={meetOrSliceTypes[modes[1]] || 0}
41+
align={alignEnum[modes[0]] || "xMidYMid"}
42+
src={Image.resolveAssetSource(href)}
43+
/>
44+
);
45+
}
4946
}
5047

5148
const RNSVGImage = requireNativeComponent("RNSVGImage");

Diff for: elements/Line.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
44
import Shape from "./Shape";
55

66
export default class Line extends Shape {
7-
static displayName = "Line";
7+
static displayName = "Line";
88

9-
static defaultProps = {
10-
x1: 0,
11-
y1: 0,
12-
x2: 0,
13-
y2: 0,
14-
};
9+
static defaultProps = {
10+
x1: 0,
11+
y1: 0,
12+
x2: 0,
13+
y2: 0,
14+
};
1515

16-
render() {
17-
const { props } = this;
18-
const { x1, y1, x2, y2 } = props;
19-
return (
20-
<RNSVGLine
21-
ref={this.refMethod}
22-
{...extractProps(propsAndStyles(props), this)}
23-
x1={x1}
24-
y1={y1}
25-
x2={x2}
26-
y2={y2}
27-
/>
28-
);
29-
}
16+
render() {
17+
const { props } = this;
18+
const { x1, y1, x2, y2 } = props;
19+
return (
20+
<RNSVGLine
21+
ref={this.refMethod}
22+
{...extractProps(propsAndStyles(props), this)}
23+
x1={x1}
24+
y1={y1}
25+
x2={x2}
26+
y2={y2}
27+
/>
28+
);
29+
}
3030
}
3131

3232
const RNSVGLine = requireNativeComponent("RNSVGLine");

Diff for: elements/LinearGradient.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ import extractGradient from "../lib/extract/extractGradient";
44
import Shape from "./Shape";
55

66
export default class LinearGradient extends Shape {
7-
static displayName = "LinearGradient";
7+
static displayName = "LinearGradient";
88

9-
static defaultProps = {
10-
x1: "0%",
11-
y1: "0%",
12-
x2: "100%",
13-
y2: "0%",
14-
};
9+
static defaultProps = {
10+
x1: "0%",
11+
y1: "0%",
12+
x2: "100%",
13+
y2: "0%",
14+
};
1515

16-
render() {
17-
const { props } = this;
18-
const { x1, y1, x2, y2 } = props;
19-
return (
20-
<RNSVGLinearGradient
21-
ref={this.refMethod}
22-
x1={x1}
23-
y1={y1}
24-
x2={x2}
25-
y2={y2}
26-
{...extractGradient(props, this)}
27-
/>
28-
);
29-
}
16+
render() {
17+
const { props } = this;
18+
const { x1, y1, x2, y2 } = props;
19+
return (
20+
<RNSVGLinearGradient
21+
ref={this.refMethod}
22+
x1={x1}
23+
y1={y1}
24+
x2={x2}
25+
y2={y2}
26+
{...extractGradient(props, this)}
27+
/>
28+
);
29+
}
3030
}
3131

3232
const RNSVGLinearGradient = requireNativeComponent("RNSVGLinearGradient");

0 commit comments

Comments
 (0)