react-crud-mobile 1.3.556 → 1.3.558
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/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIButton.tsx +4 -10
- package/src/elements/core/UIModal.tsx +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,6 @@ import { Pressable, Text, Modal, View, TouchableWithoutFeedback } from 'react-na
|
|
|
3
3
|
import UI from '../UI';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import LoadingIcon from './LoadingIcon';
|
|
6
|
-
import Animated, { useSharedValue, useAnimatedStyle, withSpring, withTiming } from 'react-native-reanimated';
|
|
7
6
|
|
|
8
7
|
const BUTTONS_SIZE: any = { small: { minWidth: 30, height: 30 } };
|
|
9
8
|
|
|
@@ -21,12 +20,6 @@ export default function UIButton(props: ChildType) {
|
|
|
21
20
|
let icon = scope.getPart('icon');
|
|
22
21
|
let children = ComponentUtils.getChild(props, 'button');
|
|
23
22
|
|
|
24
|
-
const pressed = useSharedValue(0);
|
|
25
|
-
const animatedStyle = useAnimatedStyle(() => ({
|
|
26
|
-
transform: [{ translateY: withTiming(pressed.value ? 2 : 0, { duration: 80 }) }],
|
|
27
|
-
opacity: withTiming(pressed.value ? 0.9 : 1, { duration: 80 }),
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
23
|
if (!color) color = 'primaryLight';
|
|
31
24
|
|
|
32
25
|
const styles: any = {
|
|
@@ -69,6 +62,7 @@ export default function UIButton(props: ChildType) {
|
|
|
69
62
|
};
|
|
70
63
|
|
|
71
64
|
const onClick = () => {
|
|
65
|
+
// 👉 Se tiver children, abre modal
|
|
72
66
|
if (!Utils.isEmpty(children)) {
|
|
73
67
|
setOpen(true);
|
|
74
68
|
return;
|
|
@@ -165,11 +159,11 @@ export default function UIButton(props: ChildType) {
|
|
|
165
159
|
|
|
166
160
|
return (
|
|
167
161
|
<>
|
|
168
|
-
<Pressable onPress={onClick}
|
|
169
|
-
|
|
162
|
+
<Pressable onPress={onClick} style={({ pressed }) => [buttonStyle, pressed && { opacity: 0.5 }]}>
|
|
163
|
+
<>
|
|
170
164
|
{icon && <UI.Icon size={iconSize} style={iconStyle} value={icon} />}
|
|
171
165
|
{label && <Text style={buttonLabel}>{label}</Text>}
|
|
172
|
-
|
|
166
|
+
</>
|
|
173
167
|
</Pressable>
|
|
174
168
|
|
|
175
169
|
{/* 🔥 MODAL */}
|
|
@@ -69,7 +69,7 @@ export default function UIModal(props: UIModalType) {
|
|
|
69
69
|
);
|
|
70
70
|
};
|
|
71
71
|
return (
|
|
72
|
-
<Modal key={key} animationType="slide"
|
|
72
|
+
<Modal key={key} animationType="slide" visible={true} onRequestClose={onClose}>
|
|
73
73
|
<ModalInner />
|
|
74
74
|
</Modal>
|
|
75
75
|
);
|