2015-03-23 20:28:42 +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
|
|
|
|
|
|
|
#import "RCTTabBarItemManager.h"
|
|
|
|
|
|
|
|
#import "RCTConvert.h"
|
|
|
|
#import "RCTTabBarItem.h"
|
|
|
|
|
|
|
|
@implementation RCTTabBarItemManager
|
|
|
|
|
2015-04-08 12:42:43 +00:00
|
|
|
RCT_EXPORT_MODULE()
|
|
|
|
|
2015-03-06 00:36:41 +00:00
|
|
|
- (UIView *)view
|
|
|
|
{
|
|
|
|
return [[RCTTabBarItem alloc] init];
|
|
|
|
}
|
|
|
|
|
2015-03-26 04:29:28 +00:00
|
|
|
RCT_EXPORT_VIEW_PROPERTY(selected, BOOL);
|
2015-06-25 13:00:02 +00:00
|
|
|
RCT_EXPORT_VIEW_PROPERTY(icon, id);
|
2015-03-26 08:43:17 +00:00
|
|
|
RCT_REMAP_VIEW_PROPERTY(selectedIcon, barItem.selectedImage, UIImage);
|
2015-04-22 04:07:17 +00:00
|
|
|
RCT_REMAP_VIEW_PROPERTY(badge, barItem.badgeValue, NSString);
|
2015-03-26 04:29:28 +00:00
|
|
|
RCT_CUSTOM_VIEW_PROPERTY(title, NSString, RCTTabBarItem)
|
2015-03-06 00:36:41 +00:00
|
|
|
{
|
|
|
|
view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title;
|
|
|
|
view.barItem.imageInsets = [view.barItem.title length] ? UIEdgeInsetsZero : (UIEdgeInsets){6, 0, -6, 0};
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|