ordering-ui-react-native 0.12.91 → 0.12.92

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.12.91",
3
+ "version": "0.12.92",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -98,6 +98,7 @@
98
98
  "react-native-restart": "^0.0.22",
99
99
  "react-native-safe-area-context": "^3.1.8",
100
100
  "react-native-screens": "^2.11.0",
101
+ "react-native-select-dropdown": "^1.7.0",
101
102
  "react-native-signature-canvas": "^4.3.0",
102
103
  "react-native-snap-carousel": "^3.9.1",
103
104
  "react-native-sound": "^0.11.1",
package/src/config.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "app_id": "react-native-app",
3
3
  "notification_app": "orderingapp",
4
4
  "app_name": "Ordering",
5
- "project": "luisv4",
5
+ "project": "reactdemo",
6
6
  "api": {
7
7
  "url": "https://apiv4.ordering.co",
8
8
  "language": "en",
@@ -32,6 +32,8 @@ import {
32
32
  import CalendarPicker from 'react-native-calendar-picker';
33
33
  import { TouchableRipple } from 'react-native-paper';
34
34
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
35
+ import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
36
+ import SelectDropdown from 'react-native-select-dropdown';
35
37
 
36
38
  const MomentOptionUI = (props: MomentOptionParams) => {
37
39
  const {
@@ -171,7 +173,6 @@ const MomentOptionUI = (props: MomentOptionParams) => {
171
173
  },
172
174
  };
173
175
  };
174
-
175
176
  return (
176
177
  <>
177
178
  <Container style={{ paddingLeft: 40, paddingRight: 40 }}>
@@ -229,8 +230,56 @@ const MomentOptionUI = (props: MomentOptionParams) => {
229
230
  {datesList.length > 0 && (
230
231
  <View style={styles.dateWrap}>
231
232
  <View style={styles.dateLabel}>
232
- <OText size={12} color={theme.colors.disabled}>{dateSelected}</OText>
233
+ <OText size={12} color={theme.colors.textNormal}>{dateSelected}</OText>
233
234
  </View>
235
+ <SelectDropdown
236
+ defaultButtonText={timeSelected ? timeSelected : t('DELIVERY_TIME', 'Delivery Time')}
237
+ defaultValue={74}
238
+ data={hoursList}
239
+ disabled={orderState.loading}
240
+ onSelect={(selectedItem, index) => {
241
+ setSelectedTime(selectedItem.startTime)
242
+ }}
243
+ buttonTextAfterSelection={(selectedItem, index) => {
244
+ return `${selectedItem.startTime} - ${selectedItem.endTime}`
245
+ }}
246
+ rowTextForSelection={(item, index) => {
247
+ return `${item.startTime} - ${item.endTime}`
248
+ }}
249
+ buttonStyle={{
250
+ backgroundColor: theme.colors.white,
251
+ borderColor: theme.colors.border,
252
+ borderWidth: 1,
253
+ borderRadius: 8,
254
+ height: 40,
255
+ width: '100%',
256
+ flexDirection: 'column',
257
+ alignItems: 'flex-start',
258
+ marginBottom: 20
259
+ }}
260
+ buttonTextStyle={{
261
+ color: theme.colors.textNormal,
262
+ fontSize: 12,
263
+ paddingTop: 10
264
+ }}
265
+ dropdownStyle={{
266
+ borderRadius: 8,
267
+ borderColor: theme.colors.lightGray,
268
+ }}
269
+ rowStyle={{
270
+ borderBottomColor: theme.colors.white,
271
+ backgroundColor: theme.colors.white,
272
+ height: 40,
273
+ flexDirection: 'column',
274
+ alignItems: 'flex-start',
275
+ paddingTop: 8,
276
+ paddingLeft: 22
277
+ }}
278
+ rowTextStyle={{
279
+ color: theme.colors.textNormal,
280
+ fontSize: 14,
281
+ }}
282
+ />
234
283
  <CalendarPicker
235
284
  nextTitle=">"
236
285
  width={width - 80}
@@ -264,50 +313,6 @@ const MomentOptionUI = (props: MomentOptionParams) => {
264
313
  />
265
314
  </View>
266
315
  )}
267
-
268
- {hoursList.length > 0 && optionSelected.isSchedule && (
269
- <>
270
- <TouchableRipple style={styles.timeLabel} onPress={() => { setToggleTime(!toggleTime) }}>
271
- <>
272
- <OIcon src={theme.images.general.clock} width={16} />
273
- <OText style={{ flexGrow: 1, paddingHorizontal: 12 }} color={theme.colors.disabled}>{timeSelected ? timeSelected : t('DELIVERY_TIME', 'Delivery Time')}</OText>
274
- <OIcon src={theme.images.general.arrow_down} width={16} style={{ transform: [{ rotate: toggleTime ? '180deg' : '0deg' }] }} />
275
- </>
276
- </TouchableRipple>
277
- {toggleTime ? (
278
-
279
- <WrapHours nestedScrollEnabled={true}>
280
- <Hours name="hours">
281
- {hoursList.map((hour: any, i: any) => (
282
- <Hour
283
- key={i}
284
- onPress={() => setSelectedTime(hour.startTime)}
285
- disabled={orderState.loading}
286
- style={{ borderColor: selectedTime === hour.startTime ? theme.colors.primary : theme.colors.border }}
287
- >
288
- <OText
289
- color={
290
- selectedTime === hour.startTime
291
- ? theme.colors.primary
292
- : theme.colors.textSecondary
293
- }>
294
- {configs?.format_time?.value === '12'
295
- ? hour.startTime.includes('12')
296
- ? `${hour.startTime}PM`
297
- : parseTime(moment(hour.startTime, 'HH:mm'), {
298
- outputFormat: 'hh:mma',
299
- })
300
- : parseTime(moment(hour.startTime, 'HH:mm'), {
301
- outputFormat: 'HH:mm',
302
- })}
303
- </OText>
304
- </Hour>
305
- ))}
306
- </Hours>
307
- </WrapHours>
308
- ) : null}
309
- </>
310
- )}
311
316
  </WrapDelveryTime>
312
317
  )}
313
318
  </View>