ordering-ui-react-native 0.24.8 → 0.24.9

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": "ordering-ui-react-native",
3
- "version": "0.24.8",
3
+ "version": "0.24.9",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,18 +1,26 @@
1
- import React from 'react'
1
+ import React, { useMemo } from 'react'
2
2
  import { Dimensions, Platform } from 'react-native'
3
3
  import { WebView } from 'react-native-webview'
4
4
  import { useLanguage } from 'ordering-components/native'
5
-
5
+ import { useSafeAreaInsets } from 'react-native-safe-area-context'
6
6
  import { Container } from '../../layouts/Container'
7
7
  import { NotFoundSource } from '../NotFoundSource'
8
8
  import NavBar from '../NavBar'
9
9
 
10
- const HEIGHT_SCREEN = Dimensions.get('screen').height
11
-
12
10
  export const HelpOptions = (props: any) => {
13
11
  const { item, goToBack } = props
14
12
  const [, t] = useLanguage()
15
13
 
14
+ const insets = useSafeAreaInsets()
15
+
16
+ const containerHeight = useMemo(() => {
17
+ const windowHeight = Dimensions.get('window').height
18
+ const bottomPadding = Platform.OS === 'ios' ? insets.bottom : 0
19
+ const navigationBarHeight = Platform.OS === 'android' ? 48 : 0
20
+ const topPadding = (Platform.OS === 'ios' ? 20 : 10) + 48
21
+ return windowHeight - bottomPadding - navigationBarHeight - topPadding
22
+ }, [insets.bottom])
23
+
16
24
  return (
17
25
  <Container
18
26
  pt={Platform.OS === 'ios' ? 20 : 10}
@@ -30,7 +38,8 @@ export const HelpOptions = (props: any) => {
30
38
  originWhitelist={['*']}
31
39
  automaticallyAdjustContentInsets={false}
32
40
  source={{ html: item.body }}
33
- style={{ flex: 1, height: HEIGHT_SCREEN }}
41
+ style={{ flex: 1, height: containerHeight }}
42
+ nestedScrollEnabled
34
43
  />
35
44
  )}
36
45
  {!item?.body && (