Przeglądaj źródła

Fix backButton.color change on mergeOptions (#6145)

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
Yogev Ben David 4 lat temu
rodzic
commit
da0fd194f8
No account linked to committer's email address

+ 0
- 5
lib/ios/RNNStackPresenter.m Wyświetl plik

@@ -63,7 +63,6 @@
63 63
     
64 64
     [stack setNavigationBarBlur:[withDefault.topBar.background.blur getWithDefaultValue:NO]];
65 65
     [stack setNavigationBarClipsToBounds:[withDefault.topBar.background.clipToBounds getWithDefaultValue:NO]];
66
-    [stack setBackButtonColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil]];
67 66
 	
68 67
 	[stack.view setBackgroundColor:[withDefault.layout.backgroundColor getWithDefaultValue:nil]];
69 68
 }
@@ -114,10 +113,6 @@
114 113
     if (options.topBar.background.blur.hasValue) {
115 114
         [stack setNavigationBarBlur:[options.topBar.background.blur get]];
116 115
     }
117
-    
118
-    if (options.topBar.backButton.color.hasValue) {
119
-        [stack setBackButtonColor:options.topBar.backButton.color.get];
120
-    }
121 116
 
122 117
     if (options.topBar.background.component.name.hasValue) {
123 118
         [self setCustomNavigationComponentBackground:options perform:nil];

+ 1
- 1
lib/ios/TopBarPresenter.m Wyświetl plik

@@ -123,7 +123,7 @@
123 123
     
124 124
     NSArray* stackChildren = self.navigationController.viewControllers;
125 125
     UIViewController *lastViewControllerInStack = stackChildren.count > 1 ? stackChildren[stackChildren.count - 2] : self.navigationController.topViewController;
126
-    UIBarButtonItem *backItem = lastViewControllerInStack.navigationItem.backBarButtonItem ?: [UIBarButtonItem new];
126
+    UIBarButtonItem *backItem = [UIBarButtonItem new];
127 127
     backItem.accessibilityIdentifier = testID;
128 128
 
129 129
     icon = color

+ 0
- 2
lib/ios/UINavigationController+RNNOptions.h Wyświetl plik

@@ -16,6 +16,4 @@
16 16
 
17 17
 - (void)setNavigationBarClipsToBounds:(BOOL)clipsToBounds;
18 18
 
19
-- (void)setBackButtonColor:(UIColor *)color;
20
-
21 19
 @end

+ 0
- 4
lib/ios/UINavigationController+RNNOptions.m Wyświetl plik

@@ -54,10 +54,6 @@ const NSInteger BLUR_TOPBAR_TAG = 78264802;
54 54
 	}
55 55
 }
56 56
 
57
-- (void)setBackButtonColor:(UIColor *)color {
58
-	self.navigationBar.tintColor = color;
59
-}
60
-
61 57
 - (void)setNavigationBarClipsToBounds:(BOOL)clipsToBounds {
62 58
 	self.navigationBar.clipsToBounds = clipsToBounds;
63 59
 }

+ 0
- 13
playground/ios/NavigationTests/RNNStackPresenterTest.m Wyświetl plik

@@ -25,19 +25,6 @@
25 25
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
26 26
 }
27 27
 
28
-- (void)testApplyOptions_shouldSetBackButtonColor_withDefaultValues {
29
-	[[(id)_boundViewController expect] setBackButtonColor:nil];
30
-	[self.uut applyOptions:self.options];
31
-	[(id)_boundViewController verify];
32
-}
33
-
34
-- (void)testApplyOptions_shouldSetBackButtonColor_withColor {
35
-	self.options.topBar.backButton.color = [[Color alloc] initWithValue:[UIColor redColor]];
36
-	[[(id)_boundViewController expect] setBackButtonColor:[UIColor redColor]];
37
-	[self.uut applyOptions:self.options];
38
-	[(id)_boundViewController verify];
39
-}
40
-
41 28
 - (void)testApplyOptionsBeforePoppingShouldSetTopBarBackgroundForPoppingViewController {
42 29
 	_options.topBar.background.color = [[Color alloc] initWithValue:[UIColor redColor]];
43 30