Parcourir la source

Fixes topBar.title.component with default options

yogevbd il y a 6 ans
Parent
révision
aa4326d5e0
1 fichiers modifiés avec 9 ajouts et 9 suppressions
  1. 9
    9
      lib/ios/RNNRootViewController.m

+ 9
- 9
lib/ios/RNNRootViewController.m Voir le fichier

@@ -41,7 +41,7 @@
41 41
 	self.options = options;
42 42
 	[self.presenter applyOptionsOnInit:self.options];
43 43
 	
44
-	self.animator = [[RNNAnimator alloc] initWithTransitionOptions:self.options.customTransition];
44
+	self.animator = [[RNNAnimator alloc] initWithTransitionOptions:self.optionsWithDefault.customTransition];
45 45
 	
46 46
 	[[NSNotificationCenter defaultCenter] addObserver:self
47 47
 											 selector:@selector(onJsReload)
@@ -156,7 +156,7 @@
156 156
 }
157 157
 
158 158
 - (void)setTitleViewWithSubtitle {
159
-	if (self.options.topBar.subtitle.text.hasValue) {
159
+	if (self.optionsWithDefault.topBar.subtitle.text.hasValue) {
160 160
 		RNNTitleViewHelper* titleViewHelper = [[RNNTitleViewHelper alloc] initWithTitleViewOptions:self.optionsWithDefault.topBar.title subTitleOptions:self.optionsWithDefault.topBar.subtitle viewController:self];
161 161
 		[titleViewHelper setup];
162 162
 	}
@@ -164,10 +164,10 @@
164 164
 
165 165
 - (void)setCustomNavigationTitleView {
166 166
 	if (!_customTitleView && _isBeingPresented) {
167
-		if (self.options.topBar.title.component.name.hasValue) {
168
-			_customTitleView = (RNNReactView*)[_creator createRootViewFromComponentOptions:self.options.topBar.title.component];
167
+		if (self.optionsWithDefault.topBar.title.component.name.hasValue) {
168
+			_customTitleView = (RNNReactView*)[_creator createRootViewFromComponentOptions:self.optionsWithDefault.topBar.title.component];
169 169
 			_customTitleView.backgroundColor = UIColor.clearColor;
170
-			NSString* alignment = [self.options.topBar.title.component.alignment getWithDefaultValue:@""];
170
+			NSString* alignment = [self.optionsWithDefault.topBar.title.component.alignment getWithDefaultValue:@""];
171 171
 			[_customTitleView setAlignment:alignment];
172 172
 			BOOL isCenter = [alignment isEqualToString:@"center"];
173 173
 			__weak RNNReactView *weakTitleView = _customTitleView;
@@ -193,8 +193,8 @@
193 193
 
194 194
 - (void)setCustomNavigationBarView {
195 195
 	if (!_customTopBar) {
196
-		if (self.options.topBar.component.name.hasValue) {
197
-			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.options.topBar.component];
196
+		if (self.optionsWithDefault.topBar.component.name.hasValue) {
197
+			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.optionsWithDefault.topBar.component];
198 198
 			
199 199
 			_customTopBar = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
200 200
 			reactView.backgroundColor = UIColor.clearColor;
@@ -213,8 +213,8 @@
213 213
 
214 214
 - (void)setCustomNavigationComponentBackground {
215 215
 	if (!_customTopBarBackground) {
216
-		if (self.options.topBar.background.component.name.hasValue) {
217
-			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.options.topBar.background.component];
216
+		if (self.optionsWithDefault.topBar.background.component.name.hasValue) {
217
+			RCTRootView *reactView = (RCTRootView*)[_creator createRootViewFromComponentOptions:self.optionsWithDefault.topBar.background.component];
218 218
 			
219 219
 			_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
220 220
 			[self.navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];