mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 01:25:39 +00:00
a50bafa678
Summary: **motivation:** make possible to use new tab bar item property ![1476033023249](https://cloud.githubusercontent.com/assets/1488195/19222245/f4c1292c-8e64-11e6-8a29-7b95b45e153c.jpg) Closes https://github.com/facebook/react-native/pull/10315 Differential Revision: D4000011 Pulled By: mmmulani fbshipit-source-id: 5c00b0b5f56c551cc4151fcc030da6c8bc1a3649
39 lines
1.1 KiB
Objective-C
39 lines
1.1 KiB
Objective-C
/**
|
|
* 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.
|
|
*/
|
|
|
|
#import "RCTTabBarItemManager.h"
|
|
|
|
#import "RCTConvert.h"
|
|
#import "RCTTabBarItem.h"
|
|
|
|
@implementation RCTTabBarItemManager
|
|
|
|
RCT_EXPORT_MODULE()
|
|
|
|
- (UIView *)view
|
|
{
|
|
return [RCTTabBarItem new];
|
|
}
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(badge, id /* NSString or NSNumber */)
|
|
RCT_EXPORT_VIEW_PROPERTY(renderAsOriginal, BOOL)
|
|
RCT_EXPORT_VIEW_PROPERTY(selected, BOOL)
|
|
RCT_EXPORT_VIEW_PROPERTY(icon, UIImage)
|
|
RCT_EXPORT_VIEW_PROPERTY(selectedIcon, UIImage)
|
|
RCT_EXPORT_VIEW_PROPERTY(systemIcon, UITabBarSystemItem)
|
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
RCT_EXPORT_VIEW_PROPERTY(badgeColor, UIColor)
|
|
RCT_CUSTOM_VIEW_PROPERTY(title, NSString, RCTTabBarItem)
|
|
{
|
|
view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title;
|
|
view.barItem.imageInsets = view.barItem.title.length ? UIEdgeInsetsZero : (UIEdgeInsets){6, 0, -6, 0};
|
|
}
|
|
|
|
@end
|