react-crud-mobile 1.0.364 → 1.0.366

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.
@@ -1,4 +1,4 @@
1
- import { useState } from 'react';
1
+ import { useEffect, useState } from 'react';
2
2
  import { ChildType, MethodType, useTheme, Utils } from 'react-crud-utils';
3
3
  import {
4
4
  Text,
@@ -38,7 +38,16 @@ export default function UIModal(props: ChildType) {
38
38
  toggle(true);
39
39
  };
40
40
 
41
- console.log(theme.colors.primary);
41
+ useEffect(() => {
42
+ if (modalVisible) {
43
+ StatusBar.setBarStyle('light-content');
44
+ StatusBar.setBackgroundColor?.(theme.colors.primary);
45
+ } else {
46
+ StatusBar.setBarStyle('dark-content');
47
+ StatusBar.setBackgroundColor?.('#f5f5f5');
48
+ }
49
+ }, [modalVisible]);
50
+
42
51
  return (
43
52
  <Modal
44
53
  animationType="slide"
@@ -46,28 +55,25 @@ export default function UIModal(props: ChildType) {
46
55
  visible={modalVisible}
47
56
  onRequestClose={() => setModalVisible(false)}
48
57
  >
49
- <StatusBar
50
- barStyle="light-content"
51
- translucent={false}
52
- backgroundColor={theme.colors.primary}
53
- />
54
- <SafeAreaView style={style('modalSafe')}>
55
- <View style={style('modalHeader')}>
56
- <TouchableOpacity
57
- onPress={() => setModalVisible(false)}
58
- style={style('modalCloseButton')}
58
+ <View style={{ flex: 1, backgroundColor: theme.colors.primary }}>
59
+ <SafeAreaView style={style('modalSafe')}>
60
+ <View style={style('modalHeader')}>
61
+ <TouchableOpacity
62
+ onPress={() => setModalVisible(false)}
63
+ style={style('modalCloseButton')}
64
+ >
65
+ <Text style={style('modalCloseText')}>X</Text>
66
+ </TouchableOpacity>
67
+ <Text style={style('modalTitle')}>{label}</Text>
68
+ </View>
69
+ <ScrollView
70
+ contentContainerStyle={{ flexGrow: 1 }}
71
+ style={style('modalContent')}
59
72
  >
60
- <Text style={style('modalCloseText')}>X</Text>
61
- </TouchableOpacity>
62
- <Text style={style('modalTitle')}>{label}</Text>
63
- </View>
64
- <ScrollView
65
- contentContainerStyle={{ flexGrow: 1 }}
66
- style={style('modalContent')}
67
- >
68
- <View style={{ flex: 1 }}>{props.children}</View>
69
- </ScrollView>
70
- </SafeAreaView>
73
+ <View style={{ flex: 1 }}>{props.children}</View>
74
+ </ScrollView>
75
+ </SafeAreaView>
76
+ </View>
71
77
  </Modal>
72
78
  );
73
79
  }