@jobber/components-native 0.108.0 → 0.108.1

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.108.0",
3
+ "version": "0.108.1",
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": "d5470a957047c13206da81b769b223f08e670d92"
127
+ "gitHead": "7d8b08e91839f535411288b03a8603f2df310a8e"
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
@@ -96,7 +99,7 @@ export function ContentOverlay({
96
99
 
97
100
  const styles = useStyles();
98
101
  const { t } = useAtlantisI18n();
99
- const { tokens } = useAtlantisTheme();
102
+ const { theme, tokens } = useAtlantisTheme();
100
103
  const isScreenReaderEnabled = useIsScreenReaderEnabled();
101
104
 
102
105
  const behavior = computeContentOverlayBehavior(
@@ -318,34 +321,42 @@ export function ContentOverlay({
318
321
  topInset={topInset}
319
322
  onDismiss={() => onClose?.()}
320
323
  >
321
- <ContentOverlayKeyboardContext.Provider value={scrollEnabled}>
322
- {scrollEnabled ? (
323
- <BottomSheetKeyboardAwareScrollView
324
- ref={scrollViewRef}
325
- contentContainerStyle={{ paddingBottom: insets.bottom }}
326
- keyboardShouldPersistTaps={
327
- keyboardShouldPersistTaps ? "handled" : "never"
328
- }
329
- showsVerticalScrollIndicator={false}
330
- onScroll={handleOnScroll}
331
- stickyHeaderIndices={[0]}
332
- bottomOffset={KEYBOARD_TOP_PADDING_AUTO_SCROLL}
333
- >
334
- {renderHeader()}
335
- <View testID="ATL-Overlay-Children">{children}</View>
336
- </BottomSheetKeyboardAwareScrollView>
337
- ) : (
338
- <BottomSheetView>
339
- {renderHeader()}
340
- <View
341
- style={{ paddingBottom: insets.bottom }}
342
- testID="ATL-Overlay-Children"
324
+ {/*
325
+ BottomSheetModal renders its children through a portal mounted outside
326
+ this component's subtree, so the AtlantisThemeContext is lost. Re-apply
327
+ the active theme here so descendants (e.g. the header title) resolve the
328
+ correct themed tokens.
329
+ */}
330
+ <AtlantisThemeContextProvider dangerouslyOverrideTheme={theme}>
331
+ <ContentOverlayKeyboardContext.Provider value={scrollEnabled}>
332
+ {scrollEnabled ? (
333
+ <BottomSheetKeyboardAwareScrollView
334
+ ref={scrollViewRef}
335
+ contentContainerStyle={{ paddingBottom: insets.bottom }}
336
+ keyboardShouldPersistTaps={
337
+ keyboardShouldPersistTaps ? "handled" : "never"
338
+ }
339
+ showsVerticalScrollIndicator={false}
340
+ onScroll={handleOnScroll}
341
+ stickyHeaderIndices={[0]}
342
+ bottomOffset={KEYBOARD_TOP_PADDING_AUTO_SCROLL}
343
343
  >
344
- {children}
345
- </View>
346
- </BottomSheetView>
347
- )}
348
- </ContentOverlayKeyboardContext.Provider>
344
+ {renderHeader()}
345
+ <View testID="ATL-Overlay-Children">{children}</View>
346
+ </BottomSheetKeyboardAwareScrollView>
347
+ ) : (
348
+ <BottomSheetView>
349
+ {renderHeader()}
350
+ <View
351
+ style={{ paddingBottom: insets.bottom }}
352
+ testID="ATL-Overlay-Children"
353
+ >
354
+ {children}
355
+ </View>
356
+ </BottomSheetView>
357
+ )}
358
+ </ContentOverlayKeyboardContext.Provider>
359
+ </AtlantisThemeContextProvider>
349
360
  </BottomSheetModal>
350
361
  );
351
362
  }