@eohjsc/react-native-smart-city 0.7.45 → 0.7.47

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.7.45",
4
+ "version": "0.7.47",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -1,5 +1,6 @@
1
1
  import React, { memo, useState, useEffect } from 'react';
2
2
  import { StyleSheet, Animated, Easing, Platform } from 'react-native';
3
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
3
4
 
4
5
  import { AccessibilityLabel } from '../../configs/Constants';
5
6
  import useKeyboardAnimated from '../../hooks/Explore/useKeyboardAnimated';
@@ -26,6 +27,7 @@ const BottomButtonView = memo(
26
27
  disableKeyBoardAnimated = false,
27
28
  }) => {
28
29
  const transY = useKeyboardAnimated();
30
+ const insets = useSafeAreaInsets();
29
31
  const [keyboardAnim] = useState(new Animated.Value(0));
30
32
 
31
33
  useEffect(() => {
@@ -46,6 +48,7 @@ const BottomButtonView = memo(
46
48
  : styleCustom.container,
47
49
  // eslint-disable-next-line react-native/no-inline-styles
48
50
  { bottom: disableKeyBoardAnimated ? 0.1 : keyboardAnim },
51
+ { paddingBottom: insets.bottom },
49
52
  rowButton && styleCustom.horizontalContainer,
50
53
  style,
51
54
  ]}
@@ -9,6 +9,7 @@ const styles = StyleSheet.create({
9
9
  contentContainer: {
10
10
  flex: 1,
11
11
  justifyContent: 'space-between',
12
+ paddingBottom: 48,
12
13
  },
13
14
  scrollContainer: {
14
15
  width: '100%',
@@ -6,6 +6,7 @@ import {
6
6
  Platform,
7
7
  Easing,
8
8
  } from 'react-native';
9
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
9
10
 
10
11
  import { Colors } from '../../configs';
11
12
  import Text from '../../commons/Text';
@@ -35,6 +36,7 @@ const ViewButtonBottom = ({
35
36
  }) => {
36
37
  const useTwoButton = leftTitle && rightTitle;
37
38
  const transY = useKeyboardAnimated();
39
+ const insets = useSafeAreaInsets();
38
40
  const [keyboardAnim] = useState(new Animated.Value(0));
39
41
 
40
42
  const RightButtonView = useMemo(() => {
@@ -56,6 +58,7 @@ const ViewButtonBottom = ({
56
58
  styles.container,
57
59
  wrapStyle,
58
60
  !disableKeyBoardAnimated && { bottom: keyboardAnim },
61
+ { paddingBottom: insets.bottom },
59
62
  ]}
60
63
  >
61
64
  {leftTitle && (
@@ -113,9 +116,10 @@ const styles = StyleSheet.create({
113
116
  paddingHorizontal: 16,
114
117
  position: 'absolute',
115
118
  bottom: 0,
119
+ backgroundColor: Colors.White,
116
120
  },
117
121
  button: {
118
- paddingVertical: 24,
122
+ height: 48,
119
123
  width: '100%',
120
124
  flex: 1,
121
125
  justifyContent: 'center',
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
- import { TouchableOpacity, View } from 'react-native';
2
+ import { ScrollView, TouchableOpacity, View } from 'react-native';
3
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
3
4
  import { useNavigation } from '@react-navigation/native';
4
5
 
5
6
  import { useTranslations } from '../../hooks/Common/useTranslations';
@@ -81,6 +82,7 @@ const SelectDeviceType = ({ route }) => {
81
82
  const [addType, setAddType] = useState();
82
83
  const [selectedAddType, setSelectedAddType] = useState();
83
84
  const permissions = useBackendPermission();
85
+ const insets = useSafeAreaInsets();
84
86
 
85
87
  const listDeviceType = useMemo(() => {
86
88
  const list = [
@@ -221,9 +223,11 @@ const SelectDeviceType = ({ route }) => {
221
223
  return (
222
224
  <View style={styles.container}>
223
225
  <HeaderCustom title={t('choose_type_of_device')} isShowSeparator />
224
- <View style={styles.contentContainer}>
226
+ <ScrollView
227
+ style={{ ...styles.contentContainer, marginBottom: insets.bottom + 48 }}
228
+ >
225
229
  <SelectDeviceGrid options={listDeviceType} onSelect={handleOnSelect} />
226
- </View>
230
+ </ScrollView>
227
231
  <ViewButtonBottom
228
232
  leftTitle={t('cancel')}
229
233
  onLeftClick={goBack}
@@ -9,9 +9,7 @@ export default StyleSheet.create({
9
9
  backgroundColor: Colors.White,
10
10
  },
11
11
  contentContainer: {
12
- flex: 1,
13
- justifyContent: 'space-between',
14
- paddingVertical: 16,
12
+ paddingTop: 16,
15
13
  },
16
14
  gridContainer: {
17
15
  flexDirection: 'row',
@@ -13,6 +13,7 @@ export default StyleSheet.create({
13
13
  contentContainer: {
14
14
  flex: 1,
15
15
  justifyContent: 'space-between',
16
+ paddingBottom: 40,
16
17
  },
17
18
  title: {
18
19
  color: Colors.Gray9,
@@ -47,6 +48,6 @@ export default StyleSheet.create({
47
48
  fontSize: 14,
48
49
  },
49
50
  wrapViewButtonStyle: {
50
- paddingTop: 70,
51
+ paddingTop: 42,
51
52
  },
52
53
  });