Skip to content

Commit

Permalink
Updating imports, bumping version #
Browse files Browse the repository at this point in the history
  • Loading branch information
corymsmith committed Jul 29, 2015
1 parent b8ba28c commit fe5e25f
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 81 deletions.
2 changes: 1 addition & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "node_modules/react-native/packager/packager.sh"
},
"dependencies": {
"react-native": "^0.7.1",
"react-native": "^0.8.0",
"react-native-icons" : "file:../"
}
}
141 changes: 68 additions & 73 deletions FAKIconImage.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,104 +6,99 @@
'use strict';

var React = require('react-native');
var { NativeModules, Text, StyleSheet, requireNativeComponent } = React;

var EdgeInsetsPropType = React.EdgeInsetsPropType;
var NativeMethodsMixin = React.NativeMethodsMixin;
var NativeModules = React.NativeModules;
var PropTypes = React.PropTypes;
var ImageResizeMode = React.ImageResizeMode;
var ImageStylePropTypes = React.ImageStylePropTypes;
var StyleSheet = React.StyleSheet;

var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheetPropType = require('StyleSheetPropType');

var createReactNativeComponentClass = require('createReactNativeComponentClass');
var flattenStyle = require('flattenStyle');
var insetsDiffer = require('insetsDiffer');

var deepDiffer = require('deepDiffer');

var invariant = require('invariant');
var merge = require('merge');
var warning = require('warning');


var FAKIconImage = React.createClass({
propTypes: {
name: PropTypes.string,
size: PropTypes.number,
color: PropTypes.string,

/**
* accessible - Whether this element should be revealed as an accessible
* element.
*/
accessible: PropTypes.bool,
/**
* accessibilityLabel - Custom string to display for accessibility.
*/
accessibilityLabel: PropTypes.string,

style: StyleSheetPropType(ImageStylePropTypes),
/**
* testID - A unique identifier for this element to be used in UI Automation
* testing scripts.
*/
testID: PropTypes.string,
},

mixins: [NativeMethodsMixin],

///**
// * `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We
// * make `this` look like an actual native component class.
// */
viewConfig: {
uiViewClassName: 'UIView',
validAttributes: ReactNativeViewAttributes.UIView
},

render: function() {

var style = flattenStyle([styles.base, this.props.style]);
invariant(style, "style must be initialized");

var name = this.props.name;
invariant(name, "name must be initialized");

var size = this.props.size;
invariant(size, "size must be initialized");

var color = this.props.color;


var nativeProps = merge(this.props, {
style,
icon : {
name: name,
size: size,
color: color
}
});
propTypes: {
name: React.PropTypes.string,
size: React.PropTypes.number,
color: React.PropTypes.string,

/**
* accessible - Whether this element should be revealed as an accessible
* element.
*/
accessible: React.PropTypes.bool,
/**
* accessibilityLabel - Custom string to display for accessibility.
*/
accessibilityLabel: React.PropTypes.string,

style: StyleSheetPropType(ImageStylePropTypes),
/**
* testID - A unique identifier for this element to be used in UI Automation
* testing scripts.
*/
testID: React.PropTypes.string,
},

mixins: [NativeMethodsMixin],

///**
// * `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We
// * make `this` look like an actual native component class.
// */
viewConfig: {
uiViewClassName: 'UIView',
validAttributes: ReactNativeViewAttributes.UIView
},

render: function () {

var style = [styles.base, this.props.style];
invariant(style, "style must be initialized");

var name = this.props.name;
invariant(name, "name must be initialized");

var size = this.props.size;
invariant(size, "size must be initialized");

var color = this.props.color;

var nativeProps = merge(this.props, {
style,
icon: {
name: name,
size: size,
color: color
}
});
return <FAKIconImageView {...nativeProps} />;
}
}
});

var styles = StyleSheet.create({
base: {
overflow: 'hidden'
}
base: {
overflow: 'hidden'
}
});

var CommonImageViewAttributes = merge(ReactNativeViewAttributes.UIView, {
accessible: true,
accessibilityLabel: true,
icon: {diff: deepDiffer},
testID: PropTypes.string
accessible: true,
accessibilityLabel: true,
icon: {diff: deepDiffer},
testID: React.PropTypes.string
});

var FAKIconImageView = createReactNativeComponentClass({
validAttributes: CommonImageViewAttributes,
uiViewClassName: 'FAKIconImage'
validAttributes: CommonImageViewAttributes,
uiViewClassName: 'FAKIconImage'
});

module.exports = FAKIconImage;
6 changes: 1 addition & 5 deletions SMXTabBarIconItemIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
'use strict';

var React = require('react-native');
var { Image, StyleSheet, View, requireNativeComponent, PropTypes, } = React;

// TODO: Replace this with a destructured require like above once 0.8.0
// is released, and set minimum version
var Dimensions = require('react-native/Libraries/Utilities/Dimensions');
var { Image, StyleSheet, View, requireNativeComponent, PropTypes, Dimensions} = React;

var onlyChild = React.Children.only;

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-icons",
"version": "0.2.0",
"version": "0.2.1",
"description": "Use 1000's of icon fonts in your React Native app including the tab bar.",
"main": "index.js",
"author": "Cory Smith <[email protected]>",
Expand All @@ -26,6 +26,6 @@
"podfile": "react-native-icons.podspec"
},
"peerDependencies": {
"react-native": ">=0.6.0 <1.0.0"
"react-native": ">=0.8.0 || 0.8.0-rc || 0.8.0-rc.2"
}
}

0 comments on commit fe5e25f

Please sign in to comment.