react-native-vector-icons
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -5,2 +5,3 @@ 'use strict'; | ||
var createIconSetFromFontello = require('./lib/create-icon-set-from-fontello'); | ||
var createIconSetFromIcoMoon = require('./lib/create-icon-set-from-icomoon'); | ||
@@ -10,2 +11,3 @@ module.exports = { | ||
createIconSetFromFontello, | ||
createIconSetFromIcoMoon | ||
}; |
@@ -7,6 +7,6 @@ /** | ||
var pick = require('lodash/object/pick'); | ||
var omit = require('lodash/object/omit'); | ||
var isString = require('lodash/lang/isString'); | ||
var isEqual = require('lodash/lang/isEqual'); | ||
var pick = require('lodash/pick'); | ||
var omit = require('lodash/omit'); | ||
var isString = require('lodash/isString'); | ||
var isEqual = require('lodash/isEqual'); | ||
@@ -205,9 +205,9 @@ var React = require('react-native'); | ||
updateIconSources: function() { | ||
updateIconSources: function(props) { | ||
var size = this.props.iconSize || TAB_BAR_ICON_SIZE; | ||
if(this.props.iconName) { | ||
getImageSource(this.props.iconName, size).then(icon => this.setState({ icon })); | ||
if(props.iconName) { | ||
getImageSource(props.iconName, size).then(icon => this.setState({ icon })); | ||
} | ||
if(this.props.selectedIconName) { | ||
getImageSource(this.props.selectedIconName, size).then(selectedIcon => this.setState({ selectedIcon })); | ||
if(props.selectedIconName) { | ||
getImageSource(props.selectedIconName, size).then(selectedIcon => this.setState({ selectedIcon })); | ||
} | ||
@@ -217,3 +217,3 @@ }, | ||
componentWillMount: function() { | ||
this.updateIconSources(); | ||
this.updateIconSources(this.props); | ||
}, | ||
@@ -224,3 +224,3 @@ | ||
if(!isEqual(pick(nextProps, keys), pick(this.props, keys))) { | ||
this.updateIconSources(); | ||
this.updateIconSources(nextProps); | ||
} | ||
@@ -227,0 +227,0 @@ }, |
{ | ||
"name": "react-native-vector-icons", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Customizable Icons for React Native with support for NavBar/TabBar, image source and full styling. Choose from 3000+ bundled icons or use your own.", | ||
@@ -53,3 +53,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"lodash": "^3.8.0", | ||
"lodash": "^4.0.0", | ||
"yargs": "^3.31.0" | ||
@@ -56,0 +56,0 @@ }, |
@@ -45,3 +45,3 @@ ![Vector Icons for React Native](https://cloud.githubusercontent.com/assets/378279/12009887/33f4ae1c-ac8d-11e5-8666-7a87458753ee.png) | ||
![XCode screenshot](https://cloud.githubusercontent.com/assets/378279/7667535/0e1fd13a-fc0c-11e4-9220-18d5c095a7be.png) | ||
![XCode screenshot](https://cloud.githubusercontent.com/assets/378279/12421498/2db1f93a-be88-11e5-89c8-2e563ba6251a.png) | ||
@@ -109,30 +109,14 @@ *Note: you need to recompile your project after adding new fonts, also ensure that they also appear under __Copy Bundle Resources__ in __Build Phases__.* | ||
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { | ||
private ReactInstanceManager mReactInstanceManager; | ||
private ReactRootView mReactRootView; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
mReactRootView = new ReactRootView(this); | ||
protected List<ReactPackage> getPackages() { | ||
return Arrays.<ReactPackage>asList( | ||
new MainReactPackage() | ||
+ , new VectorIconsPackage() | ||
); | ||
} | ||
mReactInstanceManager = ReactInstanceManager.builder() | ||
.setApplication(getApplication()) | ||
.setBundleAssetName("index.android.bundle") | ||
.setJSMainModuleName("index.android") | ||
.addPackage(new MainReactPackage()) | ||
+ .addPackage(new VectorIconsPackage()) | ||
.setUseDeveloperSupport(BuildConfig.DEBUG) | ||
.setInitialLifecycleState(LifecycleState.RESUMED) | ||
.build(); | ||
mReactRootView.startReactApplication(mReactInstanceManager, "MyApp", null); | ||
setContentView(mReactRootView); | ||
} | ||
... | ||
} | ||
``` | ||
*Note: If you're using React Native (Android) <= 0.17, [follow this instructions](https://github.com/oblador/react-native-vector-icons/blob/2fe5b97afa849652215e3258189e8ca3ea775c53/README.md#integrating-library-for-getimagesource-support)* | ||
@@ -267,2 +251,10 @@ ## `Icon` Component | ||
### `createIconSetFromIcoMoon(config[, fontFamily[, fontFile]])` | ||
```js | ||
var { createIconSetFromIcoMoon } = require('react-native-vector-icons'); | ||
var icoMoonConfig = require('./config.json'); | ||
var Icon = createIconSetFromIcoMoon(icoMoonConfig); | ||
``` | ||
## Examples | ||
@@ -269,0 +261,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
821320
44
3881
369
+ Addedlodash@4.17.21(transitive)
- Removedlodash@3.10.1(transitive)
Updatedlodash@^4.0.0