react-crud-mobile 1.3.69 → 1.3.70

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,5 +1,5 @@
1
1
  {
2
- "version": "1.3.69",
2
+ "version": "1.3.70",
3
3
  "license": "MIT",
4
4
  "description": "Uma biblioteca de componentes para React Native",
5
5
  "main": "dist/index.js",
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import { ChildType, ComponentUtils, ScopeUtils, Utils } from 'react-crud-utils';
3
3
  import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
4
4
  import UI from '../UI';
5
- import { Ionicons } from '@expo/vector-icons';
5
+ import { Ionicons, MaterialCommunityIcons } from '@expo/vector-icons';
6
6
  import DraggableFlatList, {
7
7
  ScaleDecorator,
8
8
  } from 'react-native-draggable-flatlist';
@@ -58,15 +58,23 @@ export default function UIOrder(props: ChildType) {
58
58
  });
59
59
 
60
60
  const renderItem = ({ item, drag, isActive }) => {
61
+ let state = { ...scope.getStyle('row') };
62
+
63
+ if (isActive) {
64
+ state = { ...state, ...scope.getStyle('active') };
65
+ }
66
+
61
67
  return (
62
68
  <ScaleDecorator>
63
69
  <TouchableOpacity
64
70
  style={[
65
71
  styles.row,
66
72
  { backgroundColor: isActive ? 'lightblue' : 'white' },
73
+ { ...state },
67
74
  ]}
68
75
  onLongPress={drag} // Initiate drag on long press
69
76
  >
77
+ <MaterialCommunityIcons name="drag" size={24} color="black" />
70
78
  <Text style={styles.text}>{scope.getItemLabel(item)}</Text>
71
79
  </TouchableOpacity>
72
80
  </ScaleDecorator>
@@ -101,6 +109,7 @@ const styles = StyleSheet.create({
101
109
  padding: 20,
102
110
  borderBottomWidth: 1,
103
111
  borderBottomColor: '#ccc',
112
+ borderRadius: 5,
104
113
  },
105
114
  text: {
106
115
  fontSize: 18,