Skip to content

Commit

Permalink
Shrink indent_size / tabWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Jan 29, 2019
1 parent 546f225 commit 76bc07f
Show file tree
Hide file tree
Showing 42 changed files with 1,386 additions and 1,406 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ root = true
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"trailingComma": "all",
"tabWidth": 4
"tabWidth": 2
}
38 changes: 19 additions & 19 deletions elements/Circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
import Shape from "./Shape";

export default class Circle extends Shape {
static displayName = "Circle";
static displayName = "Circle";

static defaultProps = {
cx: 0,
cy: 0,
r: 0,
};
static defaultProps = {
cx: 0,
cy: 0,
r: 0,
};

render() {
const { props } = this;
const { cx, cy, r } = props;
return (
<RNSVGCircle
ref={this.refMethod}
{...extractProps(propsAndStyles(props), this)}
cx={cx}
cy={cy}
r={r}
/>
);
}
render() {
const { props } = this;
const { cx, cy, r } = props;
return (
<RNSVGCircle
ref={this.refMethod}
{...extractProps(propsAndStyles(props), this)}
cx={cx}
cy={cy}
r={r}
/>
);
}
}

const RNSVGCircle = requireNativeComponent("RNSVGCircle");
26 changes: 13 additions & 13 deletions elements/ClipPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import extractClipPath from "../lib/extract/extractClipPath";
import Shape from "./Shape";

export default class ClipPath extends Shape {
static displayName = "ClipPath";
static displayName = "ClipPath";

render() {
const { id, children } = this.props;
return (
<RNSVGClipPath
ref={this.refMethod}
name={id}
{...extractClipPath(this.props)}
>
{children}
</RNSVGClipPath>
);
}
render() {
const { id, children } = this.props;
return (
<RNSVGClipPath
ref={this.refMethod}
name={id}
{...extractClipPath(this.props)}
>
{children}
</RNSVGClipPath>
);
}
}

const RNSVGClipPath = requireNativeComponent("RNSVGClipPath");
8 changes: 4 additions & 4 deletions elements/Defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React, { Component } from "react";
import { requireNativeComponent } from "react-native";

export default class Defs extends Component {
static displayName = "Defs";
static displayName = "Defs";

render() {
return <RNSVGDefs>{this.props.children}</RNSVGDefs>;
}
render() {
return <RNSVGDefs>{this.props.children}</RNSVGDefs>;
}
}

const RNSVGDefs = requireNativeComponent("RNSVGDefs");
42 changes: 21 additions & 21 deletions elements/Ellipse.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
import Shape from "./Shape";

export default class Ellipse extends Shape {
static displayName = "Ellipse";
static displayName = "Ellipse";

static defaultProps = {
cx: 0,
cy: 0,
rx: 0,
ry: 0,
};
static defaultProps = {
cx: 0,
cy: 0,
rx: 0,
ry: 0,
};

render() {
const { props } = this;
const { cx, cy, rx, ry } = props;
return (
<RNSVGEllipse
ref={this.refMethod}
{...extractProps(propsAndStyles(props), this)}
cx={cx}
cy={cy}
rx={rx}
ry={ry}
/>
);
}
render() {
const { props } = this;
const { cx, cy, rx, ry } = props;
return (
<RNSVGEllipse
ref={this.refMethod}
{...extractProps(propsAndStyles(props), this)}
cx={cx}
cy={cy}
rx={rx}
ry={ry}
/>
);
}
}

const RNSVGEllipse = requireNativeComponent("RNSVGEllipse");
42 changes: 21 additions & 21 deletions elements/G.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ import extractTransform from "../lib/extract/extractTransform";
import Shape from "./Shape";

export default class G extends Shape {
static displayName = "G";
static displayName = "G";

setNativeProps = props => {
const matrix = !props.matrix && extractTransform(props);
if (matrix) {
props.matrix = matrix;
}
this.root.setNativeProps(props);
};

render() {
const { props } = this;
const prop = propsAndStyles(props);
return (
<RNSVGGroup
ref={this.refMethod}
{...extractProps(prop, this)}
font={extractFont(prop)}
>
{props.children}
</RNSVGGroup>
);
setNativeProps = props => {
const matrix = !props.matrix && extractTransform(props);
if (matrix) {
props.matrix = matrix;
}
this.root.setNativeProps(props);
};

render() {
const { props } = this;
const prop = propsAndStyles(props);
return (
<RNSVGGroup
ref={this.refMethod}
{...extractProps(prop, this)}
font={extractFont(prop)}
>
{props.children}
</RNSVGGroup>
);
}
}

const RNSVGGroup = requireNativeComponent("RNSVGGroup");
71 changes: 34 additions & 37 deletions elements/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,42 @@ import Shape from "./Shape";
const spacesRegExp = /\s+/;

export default class SvgImage extends Shape {
static displayName = "Image";
static displayName = "Image";

static defaultProps = {
x: 0,
y: 0,
width: 0,
height: 0,
preserveAspectRatio: "xMidYMid meet",
};
static defaultProps = {
x: 0,
y: 0,
width: 0,
height: 0,
preserveAspectRatio: "xMidYMid meet",
};

render() {
const { props } = this;
const {
preserveAspectRatio,
x,
y,
width,
height,
xlinkHref,
href = xlinkHref,
} = props;
const modes = preserveAspectRatio.trim().split(spacesRegExp);
return (
<RNSVGImage
ref={this.refMethod}
{...extractProps(
{ ...propsAndStyles(props), x: null, y: null },
this,
)}
x={x}
y={y}
width={width}
height={height}
meetOrSlice={meetOrSliceTypes[modes[1]] || 0}
align={alignEnum[modes[0]] || "xMidYMid"}
src={Image.resolveAssetSource(href)}
/>
);
}
render() {
const { props } = this;
const {
preserveAspectRatio,
x,
y,
width,
height,
xlinkHref,
href = xlinkHref,
} = props;
const modes = preserveAspectRatio.trim().split(spacesRegExp);
return (
<RNSVGImage
ref={this.refMethod}
{...extractProps({ ...propsAndStyles(props), x: null, y: null }, this)}
x={x}
y={y}
width={width}
height={height}
meetOrSlice={meetOrSliceTypes[modes[1]] || 0}
align={alignEnum[modes[0]] || "xMidYMid"}
src={Image.resolveAssetSource(href)}
/>
);
}
}

const RNSVGImage = requireNativeComponent("RNSVGImage");
42 changes: 21 additions & 21 deletions elements/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
import Shape from "./Shape";

export default class Line extends Shape {
static displayName = "Line";
static displayName = "Line";

static defaultProps = {
x1: 0,
y1: 0,
x2: 0,
y2: 0,
};
static defaultProps = {
x1: 0,
y1: 0,
x2: 0,
y2: 0,
};

render() {
const { props } = this;
const { x1, y1, x2, y2 } = props;
return (
<RNSVGLine
ref={this.refMethod}
{...extractProps(propsAndStyles(props), this)}
x1={x1}
y1={y1}
x2={x2}
y2={y2}
/>
);
}
render() {
const { props } = this;
const { x1, y1, x2, y2 } = props;
return (
<RNSVGLine
ref={this.refMethod}
{...extractProps(propsAndStyles(props), this)}
x1={x1}
y1={y1}
x2={x2}
y2={y2}
/>
);
}
}

const RNSVGLine = requireNativeComponent("RNSVGLine");
42 changes: 21 additions & 21 deletions elements/LinearGradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ import extractGradient from "../lib/extract/extractGradient";
import Shape from "./Shape";

export default class LinearGradient extends Shape {
static displayName = "LinearGradient";
static displayName = "LinearGradient";

static defaultProps = {
x1: "0%",
y1: "0%",
x2: "100%",
y2: "0%",
};
static defaultProps = {
x1: "0%",
y1: "0%",
x2: "100%",
y2: "0%",
};

render() {
const { props } = this;
const { x1, y1, x2, y2 } = props;
return (
<RNSVGLinearGradient
ref={this.refMethod}
x1={x1}
y1={y1}
x2={x2}
y2={y2}
{...extractGradient(props, this)}
/>
);
}
render() {
const { props } = this;
const { x1, y1, x2, y2 } = props;
return (
<RNSVGLinearGradient
ref={this.refMethod}
x1={x1}
y1={y1}
x2={x2}
y2={y2}
{...extractGradient(props, this)}
/>
);
}
}

const RNSVGLinearGradient = requireNativeComponent("RNSVGLinearGradient");
Loading

0 comments on commit 76bc07f

Please sign in to comment.