ordering-ui-react-native 0.27.43-test → 0.29.43-test

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": "ordering-ui-react-native",
3
- "version": "0.27.43-test",
3
+ "version": "0.29.43-test",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -38,6 +38,7 @@
38
38
  "@react-native-async-storage/async-storage": "^1.15.5",
39
39
  "@react-native-clipboard/clipboard": "^1.8.4",
40
40
  "@react-native-community/checkbox": "^0.5.8",
41
+ "@react-native-community/datetimepicker": "^7.1.0",
41
42
  "@react-native-community/geolocation": "^2.0.2",
42
43
  "@react-native-community/masked-view": "^0.1.10",
43
44
  "@react-native-community/netinfo": "^6.0.2",
@@ -76,7 +77,6 @@
76
77
  "react-native-color-matrix-image-filters": "^5.2.10",
77
78
  "react-native-country-picker-modal": "^2.0.0",
78
79
  "react-native-credit-card-input": "^0.4.1",
79
- "react-native-date-picker": "^4.2.13",
80
80
  "react-native-device-info": "^8.7.1",
81
81
  "react-native-document-picker": "^5.2.0",
82
82
  "react-native-elements": "^3.0.0-alpha.1",
@@ -95,6 +95,7 @@
95
95
  "react-native-loading-spinner-overlay": "^2.0.0",
96
96
  "react-native-map-link": "^2.8.2",
97
97
  "react-native-maps": "^0.28.0",
98
+ "react-native-modal-datetime-picker": "^15.0.1",
98
99
  "react-native-modal-dropdown": "^1.0.1",
99
100
  "react-native-onesignal": "^4.1.1",
100
101
  "react-native-paper": "^4.7.2",
@@ -14,7 +14,7 @@ import { PhoneInputNumber } from '../PhoneInputNumber';
14
14
  import { sortInputFields } from '../../utils';
15
15
  import { ListItem } from '../UserProfile/styles';
16
16
  import moment from 'moment';
17
- import DatePicker from 'react-native-date-picker'
17
+ import DateTimePickerModal from "react-native-modal-datetime-picker";
18
18
 
19
19
  export const UserFormDetailsUI = (props: any) => {
20
20
  const {
@@ -83,7 +83,7 @@ export const UserFormDetailsUI = (props: any) => {
83
83
  const [isValid, setIsValid] = useState(false)
84
84
  const [isChanged, setIsChanged] = useState(false)
85
85
  const [isModalOpen, setIsModalOpen] = useState(false)
86
- const [birthdate, setBirthdate] = useState(user?.birthdate ? new Date(user?.birthdate) : new Date())
86
+ const [birthdate, setBirthdate] = useState(user?.birthdate ?? '')
87
87
  const [phoneInputData, setPhoneInputData] = useState({
88
88
  error: '',
89
89
  phone: {
@@ -91,6 +91,7 @@ export const UserFormDetailsUI = (props: any) => {
91
91
  cellphone: null,
92
92
  },
93
93
  });
94
+ const [isDatePickerVisible, setDatePickerVisibility] = useState(false);
94
95
  const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
95
96
 
96
97
  const isAdmin = user?.level === 0
@@ -382,11 +383,26 @@ export const UserFormDetailsUI = (props: any) => {
382
383
  <OText size={14} lineHeight={21} color={theme.colors.textNormal} weight={'500'} style={{ textTransform: 'capitalize', alignSelf: 'flex-start' }}>
383
384
  {t('BIRTHDATE', 'Birthdate')}
384
385
  </OText>
386
+ <OText size={14} lineHeight={21} color={theme.colors.textNormal} weight={'500'} style={{ alignSelf: 'flex-start' }}>
387
+ {birthdate ? moment(birthdate).format('YYYY-MM-DD') : ''}
388
+ </OText>
389
+ <OButton
390
+ text={t('SELECT_A_DATE', 'Select a Date')}
391
+ bgColor={theme.colors.primary}
392
+ textStyle={{ color: theme.colors.white, fontSize: 14 }}
393
+ borderColor={theme.colors.primary}
394
+ isDisabled={formState.loading}
395
+ imgRightSrc={null}
396
+ style={{ borderRadius: 7.6, shadowOpacity: 0, width: '100%', borderWidth: 1, marginTop: 20, marginBottom: 20 }}
397
+ onClick={() => setDatePickerVisibility(true)}
398
+ />
385
399
  <DateContainer>
386
- <DatePicker
387
- mode='date'
388
- date={birthdate}
389
- onDateChange={_handleChangeDate}
400
+ <DateTimePickerModal
401
+ isVisible={isDatePickerVisible}
402
+ mode="date"
403
+ date={birthdate ?? new Date()}
404
+ onConfirm={_handleChangeDate}
405
+ onCancel={() => setDatePickerVisibility(false)}
390
406
  />
391
407
  </DateContainer>
392
408
  </WrapperPhone>