|
@@ -54,6 +54,7 @@
|
54
|
54
|
-(RNNUIBarButtonItem*)buildButton: (NSDictionary*)dictionary {
|
55
|
55
|
NSString* buttonId = dictionary[@"id"];
|
56
|
56
|
NSString* title = dictionary[@"title"];
|
|
57
|
+ NSString* component = dictionary[@"component"];
|
57
|
58
|
|
58
|
59
|
if (!buttonId) {
|
59
|
60
|
@throw [NSException exceptionWithName:@"NSInvalidArgumentException" reason:[@"button id is not specified " stringByAppendingString:title] userInfo:nil];
|
|
@@ -66,7 +67,10 @@
|
66
|
67
|
}
|
67
|
68
|
|
68
|
69
|
RNNUIBarButtonItem *barButtonItem;
|
69
|
|
- if (iconImage) {
|
|
70
|
+ if (component) {
|
|
71
|
+ RCTRootView *view = (RCTRootView*)[self.viewController.creator createRootView:component rootViewId:buttonId];
|
|
72
|
+ barButtonItem = [[RNNUIBarButtonItem alloc] init:buttonId withCustomView:view];
|
|
73
|
+ } else if (iconImage) {
|
70
|
74
|
barButtonItem = [[RNNUIBarButtonItem alloc] init:buttonId withIcon:iconImage];
|
71
|
75
|
} else if (title) {
|
72
|
76
|
barButtonItem = [[RNNUIBarButtonItem alloc] init:buttonId withTitle:title];
|