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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-crud-mobile",
3
- "version": "1.3.556",
3
+ "version": "1.3.558",
4
4
  "license": "MIT",
5
5
  "description": "Uma biblioteca de componentes para React Native v1",
6
6
  "author": "juarez",
@@ -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} onPressIn={() => (pressed.value = 1)} onPressOut={() => (pressed.value = 0)}>
169
- <Animated.View style={[buttonStyle, animatedStyle]}>
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
- </Animated.View>
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" transparent={true} visible={true} onRequestClose={onClose}>
72
+ <Modal key={key} animationType="slide" visible={true} onRequestClose={onClose}>
73
73
  <ModalInner />
74
74
  </Modal>
75
75
  );