react-native-icons
Version:
Use 1000's of icon fonts in your React Native app including the tab bar.
49 lines (42 loc) • 1.09 kB
JavaScript
/**
*
* @providesModule SMXTabBarIOS
* @flow
*/
;
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var SMXTabBarIconItemIOS = require('SMXTabBarItemIOS');
var StyleSheet = require('StyleSheet');
var merge = require('merge');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var SMXTabBarIOS = React.createClass({
statics: {
Item: SMXTabBarIconItemIOS,
},
render: function () {
var NativeProps = {
tintColor : this.props.tintColor,
barTintColor : this.props.barTintColor
};
return (
<SMXIconTabBar style={[styles.tabGroup, this.props.style]} {...NativeProps}>
{this.props.children}
</SMXIconTabBar>
);
}
});
var styles = StyleSheet.create({
tabGroup: {
flex: 1
}
});
var config = {
validAttributes: merge(ReactIOSViewAttributes.UIView, {
tintColor: true,
barTintColor: true
}),
uiViewClassName: 'SMXTabBar',
};
var SMXIconTabBar = createReactIOSNativeComponentClass(config);
module.exports = SMXTabBarIOS;