@jobber/components-native 0.107.1 → 0.107.2-CLEANUPfi-da441ea.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.107.1",
3
+ "version": "0.107.2-CLEANUPfi-da441ea.0+da441eae",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -124,5 +124,5 @@
124
124
  "react-native-screens": ">=4.18.0",
125
125
  "react-native-svg": ">=12.0.0"
126
126
  },
127
- "gitHead": "c5da7c5d3db964c4803ccf359bc4e59ed63f668d"
127
+ "gitHead": "da441eaeb2d14f744f1991450e7ac919446ff5e5"
128
128
  }
@@ -36,7 +36,10 @@ import { useIsScreenReaderEnabled } from "../hooks";
36
36
  import { IconButton } from "../IconButton";
37
37
  import { Heading } from "../Heading";
38
38
  import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
39
- import { useAtlantisTheme } from "../AtlantisThemeContext";
39
+ import {
40
+ AtlantisThemeContextProvider,
41
+ useAtlantisTheme,
42
+ } from "../AtlantisThemeContext";
40
43
 
41
44
  /**
42
45
  * Signals whether keyboard handling inside a ContentOverlay is delegated to
@@ -92,7 +95,7 @@ export function ContentOverlay({
92
95
 
93
96
  const styles = useStyles();
94
97
  const { t } = useAtlantisI18n();
95
- const { tokens } = useAtlantisTheme();
98
+ const { theme, tokens } = useAtlantisTheme();
96
99
  const isScreenReaderEnabled = useIsScreenReaderEnabled();
97
100
 
98
101
  const behavior = computeContentOverlayBehavior(
@@ -305,34 +308,42 @@ export function ContentOverlay({
305
308
  topInset={topInset}
306
309
  onDismiss={() => onClose?.()}
307
310
  >
308
- <ContentOverlayKeyboardContext.Provider value={scrollEnabled}>
309
- {scrollEnabled ? (
310
- <BottomSheetKeyboardAwareScrollView
311
- ref={scrollViewRef}
312
- contentContainerStyle={{ paddingBottom: insets.bottom }}
313
- keyboardShouldPersistTaps={
314
- keyboardShouldPersistTaps ? "handled" : "never"
315
- }
316
- showsVerticalScrollIndicator={false}
317
- onScroll={handleOnScroll}
318
- stickyHeaderIndices={[0]}
319
- bottomOffset={KEYBOARD_TOP_PADDING_AUTO_SCROLL}
320
- >
321
- {renderHeader()}
322
- <View testID="ATL-Overlay-Children">{children}</View>
323
- </BottomSheetKeyboardAwareScrollView>
324
- ) : (
325
- <BottomSheetView>
326
- {renderHeader()}
327
- <View
328
- style={{ paddingBottom: insets.bottom }}
329
- testID="ATL-Overlay-Children"
311
+ {/*
312
+ BottomSheetModal renders its children through a portal mounted outside
313
+ this component's subtree, so the AtlantisThemeContext is lost. Re-apply
314
+ the active theme here so descendants (e.g. the header title) resolve the
315
+ correct themed tokens.
316
+ */}
317
+ <AtlantisThemeContextProvider dangerouslyOverrideTheme={theme}>
318
+ <ContentOverlayKeyboardContext.Provider value={scrollEnabled}>
319
+ {scrollEnabled ? (
320
+ <BottomSheetKeyboardAwareScrollView
321
+ ref={scrollViewRef}
322
+ contentContainerStyle={{ paddingBottom: insets.bottom }}
323
+ keyboardShouldPersistTaps={
324
+ keyboardShouldPersistTaps ? "handled" : "never"
325
+ }
326
+ showsVerticalScrollIndicator={false}
327
+ onScroll={handleOnScroll}
328
+ stickyHeaderIndices={[0]}
329
+ bottomOffset={KEYBOARD_TOP_PADDING_AUTO_SCROLL}
330
330
  >
331
- {children}
332
- </View>
333
- </BottomSheetView>
334
- )}
335
- </ContentOverlayKeyboardContext.Provider>
331
+ {renderHeader()}
332
+ <View testID="ATL-Overlay-Children">{children}</View>
333
+ </BottomSheetKeyboardAwareScrollView>
334
+ ) : (
335
+ <BottomSheetView>
336
+ {renderHeader()}
337
+ <View
338
+ style={{ paddingBottom: insets.bottom }}
339
+ testID="ATL-Overlay-Children"
340
+ >
341
+ {children}
342
+ </View>
343
+ </BottomSheetView>
344
+ )}
345
+ </ContentOverlayKeyboardContext.Provider>
346
+ </AtlantisThemeContextProvider>
336
347
  </BottomSheetModal>
337
348
  );
338
349
  }