Skip to content

Commit

Permalink
fix lint alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
xinthink committed Jan 5, 2016
1 parent 440a15f commit 44e7909
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 114 deletions.
6 changes: 0 additions & 6 deletions lib/internal/MKTouchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ MKTouchable.propTypes = {

// FIXME `no propType for native prop` error on Android
nativeBackgroundAndroid: PropTypes.object,
needsOffscreenAlphaCompositing: PropTypes.bool,
scaleX: PropTypes.number,
scaleY: PropTypes.number,
translateX: PropTypes.number,
translateY: PropTypes.number,
rotation: PropTypes.number,
};

const NativeTouchable = requireNativeComponent('MKTouchable', {
Expand Down
1 change: 0 additions & 1 deletion lib/mdl/IconToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const {
TouchableWithoutFeedback,
} = React;

const MKPropTypes = require('../MKPropTypes');
const MKColor = require('../MKColor');
const Ripple = require('./Ripple');
const utils = require('../utils');
Expand Down
10 changes: 5 additions & 5 deletions lib/mdl/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ class Slider extends Component {
this._prevPointerX = 0;
this._animatedTrackLength = new Animated.Value(0);
this._panResponder = PanResponder.create({
onStartShouldSetPanResponder: (evt, gestureState) => true,
onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
onMoveShouldSetPanResponder: (evt, gestureState) => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
onStartShouldSetPanResponder: () => true,
onStartShouldSetPanResponderCapture: () => true,
onMoveShouldSetPanResponder: () => true,
onMoveShouldSetPanResponderCapture: () => true,
onPanResponderGrant: (evt) => {
this._prevPointerX = evt.nativeEvent.locationX;
this._onTouchEvent({
Expand All @@ -211,7 +211,7 @@ class Slider extends Component {
onPanResponderTerminate: (evt, gestureState) => {
this._onPanResponderEnd(gestureState, true);
},
onShouldBlockNativeResponder: (evt, gestureState) => true,
onShouldBlockNativeResponder: () => true,
});
}

Expand Down
8 changes: 2 additions & 6 deletions lib/mdl/Textfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,8 @@ class FloatingLabel extends Component {
}

setColor(color) {
// FIXME color has to be wrapped into the style object since RN 0.13
// color has to be wrapped into the style object since RN 0.13
this.refs.label.setNativeProps({style:{color: utils.parseColor(color)}});
// color has to be an int since RN v0.12, https://github.com/facebook/react-native/issues/3300, use this with RN 0.12
// this.refs.label.setNativeProps({color: utils.parseColor(color)});
// use this with RN before 0.12
// this.refs.label.setNativeProps({color});
}

aniFloatLabel() {
Expand Down Expand Up @@ -437,7 +433,7 @@ class Textfield extends Component {
}

render() {
let floatingLabel, defaultDim;
let floatingLabel;
if (this.props.floatingLabelEnabled) {
// the floating label
floatingLabel = (
Expand Down
13 changes: 6 additions & 7 deletions lib/mdl/cards/action.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
const React = require('react-native');
let styles = require('./styles');
const styles = require('./styles');

const {
PropTypes,
View,
} = React;
} = React;

var Action = React.createClass({
const Action = React.createClass({

render(){
return <View style={styles.action}>{this.props.content}</View>
render() {
return <View style={styles.action}>{this.props.content}</View>;
},

})
});

module.exports = Action;
21 changes: 10 additions & 11 deletions lib/mdl/cards/container.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
const React = require('react-native');
let styles = require('./styles');
const styles = require('./styles');

const {
PropTypes,
View,
} = React;
} = React;

var Container = React.createClass({
const Container = React.createClass({

render(){
return (
<View style={styles.card}>
{this.props.children}
</View>
)
render() {
return (
<View style={styles.card}>
{this.props.children}
</View>
)
},
})
});

module.exports = Container;
17 changes: 8 additions & 9 deletions lib/mdl/cards/content.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
const React = require('react-native');
let styles = require('./styles');
const styles = require('./styles');

const {
PropTypes,
View,
Text,
} = React;
} = React;

var Content = React.createClass({
const Content = React.createClass({

render(){
if(this.props.children.type.displayName === "Text"){
return <Text style={styles.content}>{this.props.children}</Text>
}else{
render() {
if (this.props.children.type.displayName === 'Text') {
return <Text style={styles.content}>{this.props.children}</Text>
} else {
return <View>{this.props.children}</View>
}

},

})
});

module.exports = Content;
13 changes: 5 additions & 8 deletions lib/mdl/cards/image.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
const React = require('react-native');
let styles = require('./styles');

const {
PropTypes,
View,
Image,
} = React;
} = React;

var Imag = React.createClass({
const Image = React.createClass({

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

})
});

module.exports = Imag;
module.exports = Image;
15 changes: 4 additions & 11 deletions lib/mdl/cards/menu.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
const React = require('react-native');
let styles = require('./styles');

const {
PropTypes,
View,
Text,
} = React;
const Menu = React.createClass({

var Menu = React.createClass({

render(){
return this.props.children
render() {
return this.props.children;
},

})
});

module.exports = Menu;
86 changes: 44 additions & 42 deletions lib/mdl/cards/styles.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
const React = require('react-native');

const {
StyleSheet
} = React;
StyleSheet,
} = React;

// TODO: Plug colors etc with MKTheme
var style = StyleSheet.create({
card: {
flex : 1,
backgroundColor: "#ffffff",
borderRadius: 2,
// TODO: Plug colors etc with MKTheme
const style = StyleSheet.create({
card: {
flex: 1,
backgroundColor: '#ffffff',
borderRadius: 8,
borderColor: '#ffffff',
borderWidth: 10,

shadowColor: "rgba(0,0,0,.12)",
shadowColor: 'rgba(0,0,0,.12)',
shadowOpacity: 0.8,
shadowRadius: 2,
shadowOffset: {
height: 1,
width: 2
}
width: 2,
},
},
image : {
flex : 1,
height : 170,
resizeMode: 'cover'
},
title : {
position : "absolute",
top : 120,
left : 26,
backgroundColor: 'transparent',
padding : 16,
fontSize : 24,
color : "#000000",
fontWeight: 'bold',
},
content : {
padding : 15,
color: "rgba(0,0,0,.54)",
},
action : {
borderStyle:"solid",
borderTopColor : "rgba(0,0,0,.1)",
borderTopWidth : 1,
padding : 15,
image: {
flex: 1,
height: 170,
resizeMode: 'cover',
},
title: {
position: 'absolute',
top: 120,
left: 26,
backgroundColor: 'transparent',
padding: 16,
fontSize: 24,
color: '#000000',
fontWeight: 'bold',
},
content: {
padding: 15,
color: 'rgba(0,0,0,.54)',
},
action: {
borderStyle: 'solid',
borderTopColor: 'rgba(0,0,0,.1)',
borderTopWidth: 1,
padding: 15,

},
menu : {
position : "absolute",
top : 16,
right : 16,
backgroundColor : "transparent",
},
menu: {
position: 'absolute',
top: 16,
right: 16,
backgroundColor: 'transparent',

}
},
});

module.exports = style;
14 changes: 6 additions & 8 deletions lib/mdl/cards/title.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
const React = require('react-native');
let styles = require('./styles');
const styles = require('./styles');

const {
PropTypes,
View,
Text,
} = React;
} = React;

var Title = React.createClass({
const Title = React.createClass({

render(){
return <Text style={styles.title}>{this.props.children}</Text>
render() {
return <Text style={styles.title}>{this.props.children}</Text>
},

})
});

module.exports = Title;

0 comments on commit 44e7909

Please sign in to comment.