@@ -96,6 +96,7 @@ - (void)initProps
9696 self.hidden = YES ;
9797 _reactSubviews = [NSMutableArray new ];
9898 _backTitleVisible = YES ;
99+ _blurEffect = RNSBlurEffectStyleNone;
99100}
100101
101102- (UIView *)reactSuperview
@@ -390,8 +391,11 @@ + (UINavigationBarAppearance *)buildAppearance:(UIViewController *)vc
390391 appearance.backgroundColor = config.backgroundColor ;
391392 }
392393
393- if (config.blurEffect ) {
394- appearance.backgroundEffect = [UIBlurEffect effectWithStyle: config.blurEffect];
394+ if (config.blurEffect != RNSBlurEffectStyleNone) {
395+ appearance.backgroundEffect =
396+ [UIBlurEffect effectWithStyle: [RNSConvert tryConvertRNSBlurEffectStyleToUIBlurEffectStyle: config.blurEffect]];
397+ } else {
398+ appearance.backgroundEffect = nil ;
395399 }
396400
397401 if (config.hideShadow ) {
@@ -921,7 +925,7 @@ - (void)updateProps:(react::Props::Shared const &)props oldProps:(react::Props::
921925 _backgroundColor = RCTUIColorFromSharedColor (newScreenProps.backgroundColor );
922926
923927 if (newScreenProps.blurEffect != oldScreenProps.blurEffect ) {
924- _blurEffect = [RNSConvert UIBlurEffectStyleFromCppEquivalent : newScreenProps.blurEffect];
928+ _blurEffect = [RNSConvert RNSBlurEffectStyleFromCppEquivalent : newScreenProps.blurEffect];
925929 }
926930
927931 [self updateViewControllerIfNeeded ];
@@ -989,7 +993,7 @@ - (UIView *)view
989993RCT_EXPORT_VIEW_PROPERTY(backTitleFontSize, NSNumber )
990994RCT_EXPORT_VIEW_PROPERTY(backgroundColor, UIColor)
991995RCT_EXPORT_VIEW_PROPERTY(backTitleVisible, BOOL )
992- RCT_EXPORT_VIEW_PROPERTY(blurEffect, UIBlurEffectStyle )
996+ RCT_EXPORT_VIEW_PROPERTY(blurEffect, RNSBlurEffectStyle )
993997RCT_EXPORT_VIEW_PROPERTY(color, UIColor)
994998RCT_EXPORT_VIEW_PROPERTY(direction, UISemanticContentAttribute)
995999RCT_EXPORT_VIEW_PROPERTY(largeTitle, BOOL )
@@ -1015,36 +1019,37 @@ + (NSMutableDictionary *)blurEffectsForIOSVersion
10151019{
10161020 NSMutableDictionary *blurEffects = [NSMutableDictionary new ];
10171021 [blurEffects addEntriesFromDictionary: @{
1018- @" extraLight" : @(UIBlurEffectStyleExtraLight),
1019- @" light" : @(UIBlurEffectStyleLight),
1020- @" dark" : @(UIBlurEffectStyleDark),
1022+ @" none" : @(RNSBlurEffectStyleNone),
1023+ @" extraLight" : @(RNSBlurEffectStyleExtraLight),
1024+ @" light" : @(RNSBlurEffectStyleLight),
1025+ @" dark" : @(RNSBlurEffectStyleDark),
10211026 }];
10221027
10231028 if (@available (iOS 10.0 , *)) {
10241029 [blurEffects addEntriesFromDictionary: @{
1025- @" regular" : @(UIBlurEffectStyleRegular ),
1026- @" prominent" : @(UIBlurEffectStyleProminent ),
1030+ @" regular" : @(RNSBlurEffectStyleRegular ),
1031+ @" prominent" : @(RNSBlurEffectStyleProminent ),
10271032 }];
10281033 }
10291034#if !TARGET_OS_TV && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
10301035 __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
10311036 if (@available (iOS 13.0 , *)) {
10321037 [blurEffects addEntriesFromDictionary: @{
1033- @" systemUltraThinMaterial" : @(UIBlurEffectStyleSystemUltraThinMaterial ),
1034- @" systemThinMaterial" : @(UIBlurEffectStyleSystemThinMaterial ),
1035- @" systemMaterial" : @(UIBlurEffectStyleSystemMaterial ),
1036- @" systemThickMaterial" : @(UIBlurEffectStyleSystemThickMaterial ),
1037- @" systemChromeMaterial" : @(UIBlurEffectStyleSystemChromeMaterial ),
1038- @" systemUltraThinMaterialLight" : @(UIBlurEffectStyleSystemUltraThinMaterialLight ),
1039- @" systemThinMaterialLight" : @(UIBlurEffectStyleSystemThinMaterialLight ),
1040- @" systemMaterialLight" : @(UIBlurEffectStyleSystemMaterialLight ),
1041- @" systemThickMaterialLight" : @(UIBlurEffectStyleSystemThickMaterialLight ),
1042- @" systemChromeMaterialLight" : @(UIBlurEffectStyleSystemChromeMaterialLight ),
1043- @" systemUltraThinMaterialDark" : @(UIBlurEffectStyleSystemUltraThinMaterialDark ),
1044- @" systemThinMaterialDark" : @(UIBlurEffectStyleSystemThinMaterialDark ),
1045- @" systemMaterialDark" : @(UIBlurEffectStyleSystemMaterialDark ),
1046- @" systemThickMaterialDark" : @(UIBlurEffectStyleSystemThickMaterialDark ),
1047- @" systemChromeMaterialDark" : @(UIBlurEffectStyleSystemChromeMaterialDark ),
1038+ @" systemUltraThinMaterial" : @(RNSBlurEffectStyleSystemUltraThinMaterial ),
1039+ @" systemThinMaterial" : @(RNSBlurEffectStyleSystemThinMaterial ),
1040+ @" systemMaterial" : @(RNSBlurEffectStyleSystemMaterial ),
1041+ @" systemThickMaterial" : @(RNSBlurEffectStyleSystemThickMaterial ),
1042+ @" systemChromeMaterial" : @(RNSBlurEffectStyleSystemChromeMaterial ),
1043+ @" systemUltraThinMaterialLight" : @(RNSBlurEffectStyleSystemUltraThinMaterialLight ),
1044+ @" systemThinMaterialLight" : @(RNSBlurEffectStyleSystemThinMaterialLight ),
1045+ @" systemMaterialLight" : @(RNSBlurEffectStyleSystemMaterialLight ),
1046+ @" systemThickMaterialLight" : @(RNSBlurEffectStyleSystemThickMaterialLight ),
1047+ @" systemChromeMaterialLight" : @(RNSBlurEffectStyleSystemChromeMaterialLight ),
1048+ @" systemUltraThinMaterialDark" : @(RNSBlurEffectStyleSystemUltraThinMaterialDark ),
1049+ @" systemThinMaterialDark" : @(RNSBlurEffectStyleSystemThinMaterialDark ),
1050+ @" systemMaterialDark" : @(RNSBlurEffectStyleSystemMaterialDark ),
1051+ @" systemThickMaterialDark" : @(RNSBlurEffectStyleSystemThickMaterialDark ),
1052+ @" systemChromeMaterialDark" : @(RNSBlurEffectStyleSystemChromeMaterialDark ),
10481053 }];
10491054 }
10501055#endif
@@ -1070,6 +1075,6 @@ + (NSMutableDictionary *)blurEffectsForIOSVersion
10701075 UINavigationItemBackButtonDisplayModeDefault,
10711076 integerValue)
10721077
1073- RCT_ENUM_CONVERTER(UIBlurEffectStyle , ([self blurEffectsForIOSVersion ]), UIBlurEffectStyleExtraLight , integerValue)
1078+ RCT_ENUM_CONVERTER(RNSBlurEffectStyle , ([self blurEffectsForIOSVersion ]), RNSBlurEffectStyleNone , integerValue)
10741079
10751080@end
0 commit comments