ikualo-ui-kit-mobile 1.2.9 → 1.3.0
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
|
@@ -7,7 +7,7 @@ import useStore from '../../store';
|
|
|
7
7
|
import { IInputDate } from '../../models';
|
|
8
8
|
import { ErrorInputIcon } from '../../../assets/icons/svgs';
|
|
9
9
|
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
10
|
-
import RNDateTimePicker from '@react-native-community/datetimepicker';
|
|
10
|
+
import RNDateTimePicker, { DateTimePickerAndroid } from '@react-native-community/datetimepicker';
|
|
11
11
|
import { DialogDown } from '../dialogs/DialogDown';
|
|
12
12
|
import { BtnContained } from '../buttons/BtnContained';
|
|
13
13
|
|
|
@@ -59,6 +59,18 @@ export const InputDateTime = (props: IInputDate) => {
|
|
|
59
59
|
return `${hours}:${minutes}`;
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
+
|
|
63
|
+
const showDateTimepicker = () => {
|
|
64
|
+
DateTimePickerAndroid.open({
|
|
65
|
+
value: value || new Date(),
|
|
66
|
+
onChange: (event, selectedDate) => {
|
|
67
|
+
if (event.type === 'set' && selectedDate) {
|
|
68
|
+
onChangeText(selectedDate);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
mode: type === 'time' ? type : 'date',
|
|
72
|
+
});
|
|
73
|
+
};
|
|
62
74
|
return (
|
|
63
75
|
<View>
|
|
64
76
|
<TextInput
|
|
@@ -93,6 +105,7 @@ export const InputDateTime = (props: IInputDate) => {
|
|
|
93
105
|
<TextInput.Icon
|
|
94
106
|
onPress={() => {
|
|
95
107
|
setDialogDate(true);
|
|
108
|
+
Platform.OS === 'android' && showDateTimepicker();
|
|
96
109
|
}}
|
|
97
110
|
icon={(_) =>
|
|
98
111
|
type === 'date' || type === 'datetime' ? (
|
|
@@ -153,7 +166,7 @@ export const InputDateTime = (props: IInputDate) => {
|
|
|
153
166
|
)}
|
|
154
167
|
</>
|
|
155
168
|
)}
|
|
156
|
-
{Platform.OS === 'ios'
|
|
169
|
+
{Platform.OS === 'ios' && (
|
|
157
170
|
<DialogDown
|
|
158
171
|
isVisible={showDialogDate}
|
|
159
172
|
title={label ?? ''}
|
|
@@ -181,19 +194,6 @@ export const InputDateTime = (props: IInputDate) => {
|
|
|
181
194
|
}}
|
|
182
195
|
/>
|
|
183
196
|
</DialogDown>
|
|
184
|
-
) : (
|
|
185
|
-
showDialogDate && (
|
|
186
|
-
<RNDateTimePicker
|
|
187
|
-
display="spinner"
|
|
188
|
-
mode={type}
|
|
189
|
-
locale={lang}
|
|
190
|
-
value={value || new Date()}
|
|
191
|
-
onChange={(event, date) => {
|
|
192
|
-
if (date) onChangeText(date);
|
|
193
|
-
setDialogDate(false);
|
|
194
|
-
}}
|
|
195
|
-
/>
|
|
196
|
-
)
|
|
197
197
|
)}
|
|
198
198
|
</View>
|
|
199
199
|
);
|
|
@@ -7,8 +7,6 @@ import { View } from 'react-native';
|
|
|
7
7
|
import { InputsExamples } from '../inputs/InputsExamples';
|
|
8
8
|
import { DialogExamples } from '../dialogs/DialogExamples';
|
|
9
9
|
import { Others } from './Others';
|
|
10
|
-
import { BtnContained, Navbar } from '../../';
|
|
11
|
-
import { setGlobalTheme } from '../../config/paper.config';
|
|
12
10
|
export const Views = () => {
|
|
13
11
|
const [component, setComponent] = useState('');
|
|
14
12
|
const components = [
|
|
@@ -22,24 +20,6 @@ export const Views = () => {
|
|
|
22
20
|
|
|
23
21
|
return (
|
|
24
22
|
<>
|
|
25
|
-
<BtnContained
|
|
26
|
-
text="light"
|
|
27
|
-
onPress={() => {
|
|
28
|
-
setGlobalTheme('light');
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
<BtnContained
|
|
32
|
-
text="dark"
|
|
33
|
-
onPress={() => {
|
|
34
|
-
setGlobalTheme('dark');
|
|
35
|
-
}}
|
|
36
|
-
/>
|
|
37
|
-
<BtnContained
|
|
38
|
-
text="system"
|
|
39
|
-
onPress={() => {
|
|
40
|
-
setGlobalTheme('system');
|
|
41
|
-
}}
|
|
42
|
-
/>
|
|
43
23
|
{components.find((c) => c.value === component)?.component ?? null}
|
|
44
24
|
|
|
45
25
|
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|