ordering-ui-react-native 0.11.37 → 0.11.41

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.
Files changed (28) hide show
  1. package/package.json +2 -1
  2. package/src/theme.json +0 -1
  3. package/themes/business/index.tsx +18 -0
  4. package/themes/business/src/components/OrdersOption/index.tsx +186 -13
  5. package/themes/business/src/components/OrdersOption/styles.tsx +31 -1
  6. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +51 -0
  7. package/themes/business/src/components/OrdersOptionBusiness/styles.tsx +8 -0
  8. package/themes/business/src/components/OrdersOptionCity/index.tsx +52 -0
  9. package/themes/business/src/components/OrdersOptionCity/styles.tsx +8 -0
  10. package/themes/business/src/components/OrdersOptionDate/index.tsx +52 -0
  11. package/themes/business/src/components/OrdersOptionDate/styles.tsx +8 -0
  12. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +35 -0
  13. package/themes/business/src/components/OrdersOptionDelivery/styles.tsx +8 -0
  14. package/themes/business/src/components/OrdersOptionDriver/index.tsx +50 -0
  15. package/themes/business/src/components/OrdersOptionDriver/styles.tsx +8 -0
  16. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +49 -0
  17. package/themes/business/src/components/OrdersOptionPaymethod/styles.tsx +8 -0
  18. package/themes/business/src/components/OrdersOptionStatus/index.tsx +46 -0
  19. package/themes/business/src/components/OrdersOptionStatus/styles.tsx +8 -0
  20. package/themes/business/src/components/shared/ODropDown.tsx +195 -0
  21. package/themes/business/src/components/shared/ODropDownCalendar.tsx +328 -0
  22. package/themes/business/src/components/shared/index.tsx +4 -0
  23. package/themes/business/src/types/index.tsx +2 -0
  24. package/themes/doordash/src/components/Messages/index.tsx +45 -26
  25. package/themes/original/src/components/DriverTips/styles.tsx +4 -3
  26. package/themes/original/src/components/LoginForm/index.tsx +14 -3
  27. package/themes/original/src/components/Messages/index.tsx +48 -30
  28. package/themes/original/src/components/ProductForm/index.tsx +24 -24
@@ -36,6 +36,9 @@ const MessagesUI = (props: MessagesParams) => {
36
36
  const [formattedMessages, setFormattedMessages] = useState<Array<any>>([])
37
37
  const [isKeyboardShow, setIsKeyboardShow] = useState(false)
38
38
 
39
+ const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
40
+ const chatDisabled = previousStatus.includes(order?.status)
41
+
39
42
  const onChangeMessage = (val: string) => {
40
43
  setMessage && setMessage(val)
41
44
  }
@@ -231,33 +234,49 @@ const MessagesUI = (props: MessagesParams) => {
231
234
  )
232
235
 
233
236
  const renderComposer = (props: any) => (
234
- <View style={{ flexDirection: 'row', width: '80%' }}>
235
- <Composer
236
- {...props}
237
- textInputStyle={{
238
- backgroundColor: theme.colors.white,
239
- borderRadius: 25,
240
- paddingHorizontal: 10,
241
- borderColor: '#DBDCDB',
242
- borderWidth: 1,
243
- color: '#010300',
244
- textAlign: I18nManager.isRTL ? 'right' : 'left'
245
- }}
246
- textInputProps={{
247
- value: message,
248
- onSubmitEditing: onSubmit,
249
- returnKeyType: message ? 'send' : 'done',
250
- blurOnSubmit: true,
251
- multiline: false,
252
- numberOfLines: 1,
253
- autoCorrect: false,
254
- autoCompleteType: 'off',
255
- enablesReturnKeyAutomatically: false
237
+ chatDisabled ? (
238
+ <View
239
+ style={{
240
+ width: '100%',
241
+ flexDirection: 'column',
242
+ alignItems: 'center'
256
243
  }}
257
- placeholder={t('WRITE_MESSAGE', 'Write message...')}
258
- />
259
- <RenderActions {...props} />
260
- </View>
244
+ >
245
+ <MaterialCommunityIcon
246
+ name='close-octagon-outline'
247
+ size={24}
248
+ />
249
+ <OText size={14}>{t('NOT_SEND_MESSAGES', 'You can\'t send messages because the order has ended')}</OText>
250
+ </View>
251
+ ) : (
252
+ <View style={{ flexDirection: 'row', width: '80%' }}>
253
+ <Composer
254
+ {...props}
255
+ textInputStyle={{
256
+ backgroundColor: theme.colors.white,
257
+ borderRadius: 25,
258
+ paddingHorizontal: 10,
259
+ borderColor: '#DBDCDB',
260
+ borderWidth: 1,
261
+ color: '#010300',
262
+ textAlign: I18nManager.isRTL ? 'right' : 'left'
263
+ }}
264
+ textInputProps={{
265
+ value: message,
266
+ onSubmitEditing: onSubmit,
267
+ returnKeyType: message ? 'send' : 'done',
268
+ blurOnSubmit: true,
269
+ multiline: false,
270
+ numberOfLines: 1,
271
+ autoCorrect: false,
272
+ autoCompleteType: 'off',
273
+ enablesReturnKeyAutomatically: false
274
+ }}
275
+ placeholder={t('WRITE_MESSAGE', 'Write message...')}
276
+ />
277
+ <RenderActions {...props} />
278
+ </View>
279
+ )
261
280
  )
262
281
 
263
282
  const renderSend = (props: any) => (
@@ -13,9 +13,9 @@ export const DTWrapperTips = styled.View`
13
13
  display: flex;
14
14
  flex-direction: row;
15
15
  width: 100%;
16
- justify-content: space-between;
16
+ justify-content: space-evenly;
17
17
  align-items: center;
18
- flex-wrap: wrap;
18
+ flex-wrap: nowrap;
19
19
  `
20
20
 
21
21
  export const DTCard = styled.View`
@@ -29,6 +29,7 @@ export const DTCard = styled.View`
29
29
  max-width: 48px;
30
30
  max-height: 48px;
31
31
  margin-right: 10px;
32
+ margin-left: 10px;
32
33
  margin-top: 10px;
33
34
 
34
35
  ${(props: any) => props.isActive && css`
@@ -47,7 +48,7 @@ export const DTForm = styled.View`
47
48
  export const DTLabel = styled.Text`
48
49
  font-size: 14px;
49
50
  align-self: flex-start;
50
- color: ${(props: any) => props.theme.colors.textSecondary}
51
+ color: ${(props: any) => props.theme.colors.textSecondary};
51
52
  margin-top: 10px;
52
53
 
53
54
  ${(props: any) => props.theme?.rtl && css`
@@ -388,12 +388,23 @@ const LoginFormUI = (props: LoginParams) => {
388
388
  textStyle={{ color: 'white' }}
389
389
  imgRightSrc={null}
390
390
  isLoading={formState.loading}
391
- style={{ borderRadius: 7.6, marginTop: 10 }}
391
+ style={{ borderRadius: 7.6, marginTop: 10, marginBottom: 25 }}
392
392
  />
393
+ {onNavigationRedirect && registerButtonText && (
394
+ <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center'}}>
395
+ <OText size={14}>
396
+ {t('NEW_ON_PLATFORM', 'New on Ordering?')}
397
+ </OText>
398
+ <TouchableOpacity onPress={() => onNavigationRedirect('Signup')}>
399
+ <OText size={14} mLeft={5} color={theme.colors.skyBlue}>
400
+ {t('CREATE_ACCOUNT', 'Create account')}
401
+ </OText>
402
+ </TouchableOpacity>
403
+ </View>
404
+ )}
393
405
  </FormInput>
394
406
  )}
395
407
 
396
-
397
408
  {useLoginByCellphone &&
398
409
  loginTab === 'cellphone' &&
399
410
  configs &&
@@ -429,7 +440,7 @@ const LoginFormUI = (props: LoginParams) => {
429
440
  width: '100%',
430
441
  justifyContent: 'space-between',
431
442
  alignItems: 'center',
432
- marginVertical: 30
443
+ marginVertical: 15
433
444
  }}>
434
445
  <View style={loginStyle.line} />
435
446
  <OText
@@ -36,6 +36,8 @@ const MessagesUI = (props: MessagesParams) => {
36
36
 
37
37
  const [formattedMessages, setFormattedMessages] = useState<Array<any>>([])
38
38
  const [isKeyboardShow, setIsKeyboardShow] = useState(false)
39
+ const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
40
+ const chatDisabled = previousStatus.includes(order?.status)
39
41
  const { height } = useWindowDimensions();
40
42
  const { top, bottom } = useSafeAreaInsets();
41
43
 
@@ -236,36 +238,52 @@ const MessagesUI = (props: MessagesParams) => {
236
238
  )
237
239
 
238
240
  const renderComposer = (props: typeof ComposerProps) => (
239
- <View style={{
240
- flexDirection: 'row', width: '80%', alignItems: 'center', backgroundColor: theme.colors.backgroundGray100,
241
- borderRadius: 7.6,
242
- }}>
243
- <Composer
244
- {...props}
245
- textInputStyle={{
246
- height: 32,
247
- minHeight: 32,
248
- alignItems: 'center',
249
- justifyContent: 'center',
250
- paddingHorizontal: 12,
251
- borderColor: '#DBDCDB',
252
- color: '#010300',
253
- }}
254
- textInputProps={{
255
- value: message,
256
- onSubmitEditing: onSubmit,
257
- returnKeyType: message ? 'send' : 'done',
258
- blurOnSubmit: true,
259
- multiline: false,
260
- numberOfLines: 1,
261
- autoCorrect: false,
262
- autoCompleteType: 'off',
263
- enablesReturnKeyAutomatically: false
264
- }}
265
- placeholder={t('WRITE_MESSAGE', 'Write message...')}
266
- />
267
- <RenderActions {...props} />
268
- </View>
241
+ chatDisabled ? (
242
+ <View
243
+ style={{
244
+ width: '100%',
245
+ flexDirection: 'column',
246
+ alignItems: 'center'
247
+ }}
248
+ >
249
+ <MaterialCommunityIcon
250
+ name='close-octagon-outline'
251
+ size={24}
252
+ />
253
+ <OText size={14}>{t('NOT_SEND_MESSAGES', 'You can\'t send messages because the order has ended')}</OText>
254
+ </View>
255
+ ) : (
256
+ <View style={{
257
+ flexDirection: 'row', width: '80%', alignItems: 'center', backgroundColor: theme.colors.backgroundGray100,
258
+ borderRadius: 7.6,
259
+ }}>
260
+ <Composer
261
+ {...props}
262
+ textInputStyle={{
263
+ height: 32,
264
+ minHeight: 32,
265
+ alignItems: 'center',
266
+ justifyContent: 'center',
267
+ paddingHorizontal: 12,
268
+ borderColor: '#DBDCDB',
269
+ color: '#010300',
270
+ }}
271
+ textInputProps={{
272
+ value: message,
273
+ onSubmitEditing: onSubmit,
274
+ returnKeyType: message ? 'send' : 'done',
275
+ blurOnSubmit: true,
276
+ multiline: false,
277
+ numberOfLines: 1,
278
+ autoCorrect: false,
279
+ autoCompleteType: 'off',
280
+ enablesReturnKeyAutomatically: false
281
+ }}
282
+ placeholder={t('WRITE_MESSAGE', 'Write message...')}
283
+ />
284
+ <RenderActions {...props} />
285
+ </View>
286
+ )
269
287
  )
270
288
 
271
289
  const renderSend = (props: any) => (
@@ -165,29 +165,7 @@ export const ProductOptionsUI = (props: any) => {
165
165
  Object.keys(errors).length > 0;
166
166
 
167
167
  const ExtraOptions = ({ eID, options }: any) => (
168
- <ExtraOptionWrap
169
- horizontal
170
- showsHorizontalScrollIndicator={false}
171
- style={{ marginBottom: 20 }}
172
- contentContainerStyle={{ paddingHorizontal: 33 }}>
173
168
  <>
174
- <TouchableOpacity
175
- key={`eopt_all_0`}
176
- onPress={() => setSelectedOpt(0)}
177
- style={[
178
- styles.extraItem,
179
- {
180
- borderBottomColor:
181
- selOpt == 0 ? theme.colors.textNormal : theme.colors.border,
182
- },
183
- ]}>
184
- <OText
185
- color={selOpt == 0 ? theme.colors.textNormal : theme.colors.textSecondary}
186
- size={selOpt == 0 ? 14 : 12}
187
- weight={selOpt == 0 ? '600' : 'normal'}>
188
- {t('ALL', 'All')}
189
- </OText>
190
- </TouchableOpacity>
191
169
  {product?.ingredients.length > 0 && (
192
170
  <TouchableOpacity
193
171
  key={`eopt_all_00`}
@@ -233,7 +211,6 @@ export const ProductOptionsUI = (props: any) => {
233
211
  </React.Fragment>
234
212
  ))}
235
213
  </>
236
- </ExtraOptionWrap>
237
214
  );
238
215
 
239
216
  return (
@@ -354,9 +331,32 @@ export const ProductOptionsUI = (props: any) => {
354
331
  </>
355
332
  ) : (
356
333
  <ProductEditions>
357
- {product?.extras.map((extra: any) =>
334
+ <ExtraOptionWrap
335
+ horizontal
336
+ showsHorizontalScrollIndicator={false}
337
+ style={{ marginBottom: 20 }}
338
+ // contentContainerStyle={{ paddingHorizontal: 33 }}
339
+ >
340
+ <TouchableOpacity
341
+ key={`eopt_all_0`}
342
+ onPress={() => setSelectedOpt(0)}
343
+ style={[
344
+ styles.extraItem,
345
+ {
346
+ borderBottomColor: selOpt == 0 ? theme.colors.textNormal : theme.colors.border,
347
+ },
348
+ ]}>
349
+ <OText
350
+ color={selOpt == 0 ? theme.colors.textNormal : theme.colors.textSecondary}
351
+ size={selOpt == 0 ? 14 : 12}
352
+ weight={selOpt == 0 ? '600' : 'normal'}>
353
+ {t('ALL', 'All')}
354
+ </OText>
355
+ </TouchableOpacity>
356
+ {product?.extras.map((extra: any) =>
358
357
  <ExtraOptions key={extra.id} options={extra.options} />
359
358
  )}
359
+ </ExtraOptionWrap>
360
360
 
361
361
  {selOpt == 0 ? (
362
362
  <>