Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete useless code #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const App = () => (
backgroundInactive={'gray'}
circleActiveColor={'#30a566'}
circleInActiveColor={'#000000'}
changeValueImmediately={true}
renderInsideCircle={() => <CustomComponent />} // custom component to render inside the Switch circle (Text, Image, etc.)
changeValueImmediately={true} // if rendering inside circle, change state immediately or wait for animation to complete
innerCircleStyle={{ alignItems: "center", justifyContent: "center" }} // style for inner animated circle for what you (may) be rendering inside the circle
Expand Down
12 changes: 4 additions & 8 deletions lib/Switch.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { Component } from "react";
import React, { Component } from "react"
import {
View,
Text,
StyleSheet,
Animated,
PanResponder,
TouchableWithoutFeedback,
ViewPropTypes
} from "react-native";
import PropTypes from "prop-types";
} from "react-native"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semicolon shouldn't be removed

import PropTypes from "prop-types"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you removed semicolon?


export class Switch extends Component {
static propTypes = {
Expand All @@ -32,7 +30,6 @@ export class Switch extends Component {
innerCircleStyle: ViewPropTypes.style,
renderInsideCircle: PropTypes.func,
changeValueImmediately: PropTypes.bool,
innerCircleStyle: ViewPropTypes.style,
outerCircleStyle: ViewPropTypes.style,
renderActiveText: PropTypes.bool,
renderInActiveText: PropTypes.bool,
Expand All @@ -45,7 +42,6 @@ export class Switch extends Component {
value: false,
onValueChange: () => null,
renderInsideCircle: () => null,
innerCircleStyle: {},
disabled: false,
activeText: "On",
inActiveText: "Off",
Expand Down Expand Up @@ -180,7 +176,7 @@ export class Switch extends Component {
inputRange: [-75, 75],
outputRange: [circleInActiveColor, circleActiveColor]
});

const interpolatedCircleBorderColor = circleBorderColor.interpolate({
inputRange: [-75, 75],
outputRange: [circleInactiveBorderColor, circleActiveBorderColor]
Expand Down