react-crud-mobile 1.0.511 → 1.0.513

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.
@@ -0,0 +1,45 @@
1
+ import {
2
+ Keyboard,
3
+ KeyboardAvoidingView,
4
+ Platform,
5
+ StyleProp,
6
+ ViewStyle,
7
+ } from 'react-native';
8
+ import {
9
+ SafeAreaProvider,
10
+ SafeAreaView as SafeAreaContextView,
11
+ } from 'react-native-safe-area-context';
12
+
13
+ import { StatusBar } from 'react-native';
14
+ import { useTheme } from 'react-crud-utils';
15
+
16
+ interface SafeViewType {
17
+ safeStyle?: StyleProp<ViewStyle> | any;
18
+ viewStyle?: StyleProp<ViewStyle> | any;
19
+ children?: any;
20
+ }
21
+
22
+ export default function SafeView(props: SafeViewType) {
23
+ const theme = useTheme();
24
+
25
+ return (
26
+ <SafeAreaProvider style={props.safeStyle}>
27
+ <SafeAreaContextView
28
+ style={{ backgroundColor: theme.colors?.primary, ...props.viewStyle }}
29
+ >
30
+ <StatusBar barStyle="light-content" />
31
+
32
+ <KeyboardAvoidingView
33
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
34
+ style={{
35
+ flex: 1, // 🔹 Ocupa 100% da tela
36
+ width: '100%',
37
+ justifyContent: 'center',
38
+ }}
39
+ >
40
+ {props.children}
41
+ </KeyboardAvoidingView>
42
+ </SafeAreaContextView>
43
+ </SafeAreaProvider>
44
+ );
45
+ }
@@ -10,7 +10,7 @@ export default function UIButton(props: ChildType) {
10
10
  let label = element.label;
11
11
  let icon = element.icon;
12
12
 
13
- if (!color) color = 'primary';
13
+ if (!color) color = 'primaryLight';
14
14
 
15
15
  const styles: any = {
16
16
  buttonLabel: {
@@ -1,16 +1,4 @@
1
- import {
2
- Keyboard,
3
- KeyboardAvoidingView,
4
- Platform,
5
- ScrollView,
6
- StyleSheet,
7
- TouchableWithoutFeedback,
8
- View,
9
- } from 'react-native';
10
- import {
11
- SafeAreaProvider,
12
- SafeAreaView as SafeAreaContextView,
13
- } from 'react-native-safe-area-context';
1
+ import { ScrollView, StyleSheet, View } from 'react-native';
14
2
 
15
3
  import UIChildren from '../UIChildren';
16
4
  import { ChildType, useTheme } from 'react-crud-utils';
@@ -20,42 +8,24 @@ import { StatusBar } from 'react-native';
20
8
  export default function UIView({ scope, children }: ChildType) {
21
9
  const theme = useTheme();
22
10
  const header = scope.getPart('header', null, []);
23
- const dismissKeyboard = () => {
24
- if (Platform.OS !== 'web') {
25
- Keyboard.dismiss();
26
- }
27
- };
28
11
 
29
12
  useEffect(() => {
30
13
  StatusBar.setBarStyle('light-content');
31
14
  StatusBar.setBackgroundColor?.(theme.colors.primary);
32
15
  }, []);
33
16
  return (
34
- <SafeAreaProvider style={scope.getStyle('safe', {})}>
35
- <SafeAreaContextView style={scope.getStyle('view', styles.view)}>
36
- <StatusBar barStyle="light-content" />
37
-
38
- <KeyboardAvoidingView
39
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
40
- style={{
41
- flex: 1, // 🔹 Ocupa 100% da tela
42
- width: '100%',
43
- justifyContent: 'center',
44
- }}
17
+ <>
18
+ {header}
19
+ <View style={scope.getStyle('container', styles.container)}>
20
+ <ScrollView
21
+ keyboardShouldPersistTaps="handled"
22
+ contentContainerStyle={scope.getStyle('contentContainer', {})}
23
+ style={scope.getStyle('scroll', styles.scroll)}
45
24
  >
46
- {header}
47
- <View style={scope.getStyle('container', styles.container)}>
48
- <ScrollView
49
- keyboardShouldPersistTaps="handled"
50
- contentContainerStyle={scope.getStyle('contentContainer', {})}
51
- style={scope.getStyle('scroll', styles.scroll)}
52
- >
53
- <UIChildren scope={scope}>{children}</UIChildren>
54
- </ScrollView>
55
- </View>
56
- </KeyboardAvoidingView>
57
- </SafeAreaContextView>
58
- </SafeAreaProvider>
25
+ <UIChildren scope={scope}>{children}</UIChildren>
26
+ </ScrollView>
27
+ </View>
28
+ </>
59
29
  );
60
30
  }
61
31