2015-03-06 00:36:41 +00:00
|
|
|
/**
|
2015-03-23 20:35:08 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
2015-03-06 00:36:41 +00:00
|
|
|
*
|
|
|
|
* @providesModule TabBarIOS
|
2015-03-25 19:55:10 +00:00
|
|
|
* @flow
|
2015-03-06 00:36:41 +00:00
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var React = require('React');
|
|
|
|
var StyleSheet = require('StyleSheet');
|
2015-04-02 20:35:03 +00:00
|
|
|
var TabBarItemIOS = require('TabBarItemIOS');
|
|
|
|
var View = require('View');
|
2015-03-06 00:36:41 +00:00
|
|
|
|
2015-04-22 04:07:17 +00:00
|
|
|
var requireNativeComponent = require('requireNativeComponent');
|
2015-03-06 00:36:41 +00:00
|
|
|
|
|
|
|
var TabBarIOS = React.createClass({
|
2015-03-26 07:41:30 +00:00
|
|
|
statics: {
|
|
|
|
Item: TabBarItemIOS,
|
|
|
|
},
|
2015-04-02 20:35:03 +00:00
|
|
|
|
|
|
|
propTypes: {
|
|
|
|
style: View.propTypes.style,
|
2015-05-26 23:40:56 +00:00
|
|
|
/**
|
|
|
|
* Color of the currently selected tab icon
|
|
|
|
*/
|
|
|
|
tintColor: React.PropTypes.string,
|
|
|
|
/**
|
|
|
|
* Background color of the tab bar
|
|
|
|
*/
|
|
|
|
barTintColor: React.PropTypes.string
|
2015-04-02 20:35:03 +00:00
|
|
|
},
|
|
|
|
|
2015-03-06 00:36:41 +00:00
|
|
|
render: function() {
|
|
|
|
return (
|
2015-05-26 23:40:56 +00:00
|
|
|
<RCTTabBar
|
|
|
|
style={[styles.tabGroup, this.props.style]}
|
|
|
|
tintColor={this.props.tintColor}
|
|
|
|
barTintColor={this.props.barTintColor}>
|
2015-03-06 00:36:41 +00:00
|
|
|
{this.props.children}
|
2015-03-17 10:08:46 +00:00
|
|
|
</RCTTabBar>
|
2015-03-06 00:36:41 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
tabGroup: {
|
|
|
|
flex: 1,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-04-22 04:07:17 +00:00
|
|
|
var RCTTabBar = requireNativeComponent('RCTTabBar', TabBarIOS);
|
2015-03-06 00:36:41 +00:00
|
|
|
|
|
|
|
module.exports = TabBarIOS;
|