ordering-ui-react-native 0.13.1 → 0.13.5

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.13.01",
3
+ "version": "0.13.5",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -25,13 +25,30 @@ import AppContainer from './AppContainer';
25
25
  Sentry.init({
26
26
  environment: Platform.OS === 'ios' ? 'ios' : 'android',
27
27
  dsn: 'https://90197fffe6a1431b8c3eb79e1e36f0ee@o460529.ingest.sentry.io/5722123',
28
- release: process.env.npm_package_version ? 'ordering-ui-native@' + process.env.npm_package_version : 'ordering-ui-native@' + '0.0.2',
28
+ release: process.env.npm_package_version ? 'ordering-ui-native@' + process.env.npm_package_version : 'ordering-ui-native@' + '0.0.4',
29
29
  ignoreErrors: [
30
30
  'is not defined',
31
31
  'is not a function',
32
32
  'can\'t find variable',
33
33
  'objects are not valid',
34
- 'element type is invalid'
34
+ 'element type is invalid',
35
+ 'requiring module',
36
+ 'has not been registered',
37
+ 'failed to connect to debugger!',
38
+ 'rendered more hooks than',
39
+ 'rendered fewer hooks than',
40
+ 'should have a queue',
41
+ 'the OS most likely terminated',
42
+ 'Connection timed out',
43
+ 'java.io.EOFException',
44
+ 'Abort',
45
+ 'Segfault',
46
+ 'Failed to allocate a',
47
+ 'Application Not Responding',
48
+ 'connection no longer valid',
49
+ 'IllegalInstruction',
50
+ 'React.Children.only expected to receive a single React element child.',
51
+ 'unrecognized selector sent to instance'
35
52
  ],
36
53
  });
37
54
 
@@ -191,7 +191,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
191
191
  <>
192
192
  {!(business?.categories?.length === 0) && (
193
193
  <BusinessProductsCategories
194
- categories={[{ id: null, name: t('ALL', 'All') }, { id: 'featured', name: t('FEATURED', 'Featured') }, ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)]}
194
+ categories={[{ id: null, name: t('ALL', 'All') }, { id: 'featured', name: t('FEATURED', 'Featured') }, ...business?.categories?.sort((a: any, b: any) => a.rank - b.rank)]}
195
195
  categorySelected={categorySelected}
196
196
  onClickCategory={handleChangeCategory}
197
197
  featured={featuredProducts}
@@ -203,7 +203,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
203
203
  categories={[
204
204
  { id: null, name: t('ALL', 'All') },
205
205
  { id: 'featured', name: t('FEATURED', 'Featured') },
206
- ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
206
+ ...business?.categories?.sort((a: any, b: any) => a.rank - b.rank)
207
207
  ]}
208
208
  category={categorySelected}
209
209
  categoryState={categoryState}
@@ -52,8 +52,8 @@ export const Home = (props: any) => {
52
52
  marginTop: 10
53
53
  },
54
54
  slogan: {
55
- height: w - 80,
56
- width: w - 80
55
+ height: w * 0.6,
56
+ width: w * 0.6
57
57
  },
58
58
  buttons: {
59
59
  marginVertical: 8.5,
@@ -83,7 +83,8 @@ export const Home = (props: any) => {
83
83
 
84
84
  const loginProps = {
85
85
  navigation,
86
- useLoginByCellphone: false,
86
+ useLoginByCellphone: true,
87
+ useLoginByEmail: true,
87
88
  loginButtonText: t('SIGN_IN', 'Sign in'),
88
89
  loginButtonBackground: theme.colors.primary,
89
90
  forgotButtonText: t('FORGOT_YOUR_PASSWORD', 'Forgot your password?'),
@@ -14,7 +14,8 @@ import {
14
14
  } from 'ordering-components/native';
15
15
 
16
16
  import { FacebookLogin } from '../FacebookLogin';
17
- import { VerifyPhone } from '../VerifyPhone';
17
+ import { VerifyPhone } from '../../../../../src/components/VerifyPhone';
18
+ import { OModal } from '../../../../../src/components/shared';
18
19
 
19
20
  import {
20
21
  Container,
@@ -33,7 +34,7 @@ import {
33
34
  import { _removeStoreData } from '../../providers/StoreUtil';
34
35
  import NavBar from '../NavBar'
35
36
 
36
- import { OText, OButton, OInput, OModal, OIcon } from '../shared';
37
+ import { OText, OButton, OInput, OIcon } from '../shared';
37
38
  import { LoginParams } from '../../types';
38
39
  import { useTheme } from 'styled-components/native';
39
40
  import { useWindowDimensions } from 'react-native';
@@ -65,8 +66,23 @@ const LoginFormUI = (props: LoginParams) => {
65
66
 
66
67
  const loginStyle = StyleSheet.create({
67
68
  btnOutline: {
68
- backgroundColor: '#FFF',
69
- color: theme.colors.primary
69
+ backgroundColor: 'red',
70
+ color: theme.colors.primary,
71
+ // backgroundColor: '#EFEFEF',
72
+ borderColor: '#EFEFEF',
73
+ borderRadius: 30,
74
+ fontSize: 16,
75
+ paddingVertical: 15,
76
+ paddingHorizontal: 30,
77
+ fontWeight: '400',
78
+ textAlign: 'center',
79
+ width: '100%',
80
+ display: 'flex',
81
+ flexDirection: 'row',
82
+ alignItems: 'center',
83
+ justifyContent: 'center',
84
+ position: 'relative',
85
+ height: 52,
70
86
  },
71
87
  inputStyle: {
72
88
  marginBottom: 25,
@@ -246,7 +262,7 @@ const LoginFormUI = (props: LoginParams) => {
246
262
  {useLoginByEmail && (
247
263
  <Pressable onPress={() => handleChangeTab('email')}>
248
264
  <OTab>
249
- <OText size={18} color={loginTab === 'email' ? theme.colors.primary : theme.colors.disabled}>
265
+ <OText size={16} color={loginTab === 'email' ? theme.colors.primary : theme.colors.disabled}>
250
266
  {t('LOGIN_BY_EMAIL', 'Login by Email')}
251
267
  </OText>
252
268
  </OTab>
@@ -255,7 +271,7 @@ const LoginFormUI = (props: LoginParams) => {
255
271
  {useLoginByCellphone && (
256
272
  <Pressable onPress={() => handleChangeTab('cellphone')}>
257
273
  <OTab>
258
- <OText size={18} color={loginTab === 'cellphone' ? theme.colors.primary : theme.colors.disabled}>
274
+ <OText size={16} color={loginTab === 'cellphone' ? theme.colors.primary : theme.colors.disabled}>
259
275
  {t('LOGIN_BY_PHONE', 'Login by Phone')}
260
276
  </OText>
261
277
  </OTab>
@@ -264,15 +280,10 @@ const LoginFormUI = (props: LoginParams) => {
264
280
  </OTabs>
265
281
  </LoginWith>
266
282
  )}
267
- {/* Social login button group */}
268
- {configs && Object.keys(configs).length > 0 &&
283
+ {configs && Object.keys(configs).length > 0 &&
269
284
  (
270
285
  <>
271
286
  <ButtonsWrapper>
272
- {/* <OText size={18} mBottom={10} color={theme.colors.disabled}>
273
- {t('SELECT_AN_OPTION_TO_LOGIN', 'Select an option to login')}
274
- </OText> */}
275
-
276
287
  <SocialButtons>
277
288
  <FacebookLogin
278
289
  notificationState={notificationState}
@@ -301,8 +312,48 @@ const LoginFormUI = (props: LoginParams) => {
301
312
  handleSuccessAppleLogin={handleSuccessApple}
302
313
  />
303
314
  </SocialButtons>
304
- <OText style={{ ...theme.labels.normal, textAlign: 'center', marginBottom: 8 } as TextStyle} color={theme.colors.textSecondary}>{t('OR_CONTINUE_WITH_EMAIL', 'or continue with email')}</OText>
315
+ {loginTab !== 'cellphone' && (
316
+ <OText
317
+ style={{ ...theme.labels.normal, textAlign: 'center', marginBottom: 8 } as TextStyle}
318
+ color={theme.colors.textSecondary}
319
+ >
320
+ {t('OR_CONTINUE_WITH_EMAIL', 'or continue with email')}
321
+ </OText>
322
+ )}
305
323
  </ButtonsWrapper>
324
+
325
+ {useLoginByCellphone &&
326
+ loginTab === 'cellphone' &&
327
+ configs && Object.keys(configs).length > 0 &&
328
+ (configs?.twilio_service_enabled?.value === 'true' ||
329
+ configs?.twilio_service_enabled?.value === '1') &&
330
+ configs?.twilio_module?.value &&
331
+ (
332
+ <>
333
+ <OrSeparator>
334
+ <LineSeparator />
335
+ <OText size={16} mRight={20} mLeft={20}>
336
+ {t('OR', 'Or')}
337
+ </OText>
338
+ <LineSeparator />
339
+ </OrSeparator>
340
+
341
+ <ButtonsWrapper mBottom={20}>
342
+ <OButton
343
+ onClick={handleVerifyCodeClick}
344
+ text={t('GET_VERIFY_CODE', 'Get Verify Code')}
345
+ bgColor={theme.colors.primary}
346
+ borderColor={theme.colors.primary}
347
+ textStyle={{ color: 'white', ...theme.labels.middle } as TextStyle}
348
+ imgRightSrc={null}
349
+ isLoading={isLoadingVerifyModal}
350
+ indicatorColor={theme.colors.white}
351
+ style={{ marginTop: 0, height: 40, shadowOpacity: 0 }}
352
+ />
353
+ </ButtonsWrapper>
354
+ </>
355
+ )
356
+ }
306
357
  <View style={{ height: 1, backgroundColor: theme.colors.border, width: width }} />
307
358
  </>
308
359
  )
@@ -349,19 +400,26 @@ const LoginFormUI = (props: LoginParams) => {
349
400
  </InputWrapper>
350
401
  )}
351
402
  {useLoginByCellphone && loginTab === 'cellphone' && (
352
- <View style={{ marginBottom: 25 }}>
353
- <PhoneInputNumber
354
- data={phoneInputData}
355
- handleData={(val: any) => setPhoneInputData(val)}
356
- textInputProps={{
357
- returnKeyType: 'next',
358
- onSubmitEditing: () => inputRef?.current?.focus?.(),
359
- }}
360
- />
361
- </View>
403
+ <>
404
+ <InputWrapper style={{ marginVertical: 20 }}>
405
+ <OText style={{ ...loginStyle.inputHead, ...theme.labels.middle, alignSelf: 'center' } as TextStyle}>{t('PHONE', 'Phone')}</OText>
406
+ <PhoneInputNumber
407
+ wrapStyle={{ marginTop: 0 }}
408
+ data={phoneInputData}
409
+ handleData={(val: any) => setPhoneInputData(val)}
410
+ textInputProps={{
411
+ returnKeyType: 'next',
412
+ onSubmitEditing: () => inputRef?.current?.focus?.(),
413
+ style: { borderWidth: 0, fontSize: 12 }
414
+ }}
415
+ textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
416
+ />
417
+ </InputWrapper>
418
+ <View style={{ height: 1, backgroundColor: theme.colors.border, marginHorizontal: -40 }} />
419
+ </>
362
420
  )}
363
421
  <View style={{ height: 1, backgroundColor: theme.colors.border, width: width, marginStart: -40 }} />
364
- <InputWrapper>
422
+ <InputWrapper style={loginTab === 'cellphone' && { marginVertical: 20 }}>
365
423
  <Pressable onPress={() => inputRef.current?.focus()} style={{...loginStyle.inputHead, justifyContent: 'center', minHeight: 40}}>
366
424
  <OText style={{ ...theme.labels.middle } as TextStyle}>{t('PASSWORD', 'Password')}</OText>
367
425
  </Pressable>
@@ -400,7 +458,7 @@ const LoginFormUI = (props: LoginParams) => {
400
458
  textStyle={{ color: 'white', ...theme.labels.middle } as TextStyle}
401
459
  imgRightSrc={null}
402
460
  isLoading={formState.loading}
403
- style={{ marginTop: 48, height: 40, shadowOpacity: 0 }}
461
+ style={{ marginTop: 28, height: 40, shadowOpacity: 0 }}
404
462
  />
405
463
  </FormInput>
406
464
  )}
@@ -413,36 +471,6 @@ const LoginFormUI = (props: LoginParams) => {
413
471
  </Pressable>
414
472
  )}
415
473
 
416
- {useLoginByCellphone &&
417
- loginTab === 'cellphone' &&
418
- configs && Object.keys(configs).length > 0 &&
419
- (configs?.twilio_service_enabled?.value === 'true' ||
420
- configs?.twilio_service_enabled?.value === '1') &&
421
- (
422
- <>
423
- <OrSeparator>
424
- <LineSeparator />
425
- <OText size={18} mRight={20} mLeft={20}>
426
- {t('OR', 'Or')}
427
- </OText>
428
- <LineSeparator />
429
- </OrSeparator>
430
-
431
- <ButtonsWrapper mBottom={20}>
432
- <OButton
433
- onClick={handleVerifyCodeClick}
434
- text={t('GET_VERIFY_CODE', 'Get Verify Code')}
435
- borderColor={theme.colors.primary}
436
- style={loginStyle.btnOutline}
437
- imgRightSrc={null}
438
- isLoading={isLoadingVerifyModal}
439
- indicatorColor={theme.colors.primary}
440
- />
441
- </ButtonsWrapper>
442
- </>
443
- )
444
- }
445
-
446
474
  {onNavigationRedirect && registerButtonText && (
447
475
  <ButtonsWrapper>
448
476
  <OButton
@@ -456,10 +484,11 @@ const LoginFormUI = (props: LoginParams) => {
456
484
  )}
457
485
  </FormSide>
458
486
  <OModal
459
- open={isModalVisible}
460
- onClose={() => setIsModalVisible(false)}
461
- overScreen
462
- >
487
+ open={isModalVisible}
488
+ onClose={() => setIsModalVisible(false)}
489
+ entireModal
490
+ title={t('VERIFY_PHONE', 'Verify Phone')}
491
+ >
463
492
  <VerifyPhone
464
493
  phone={phoneInputData.phone}
465
494
  verifyPhoneState={verifyPhoneState}
@@ -467,6 +496,7 @@ const LoginFormUI = (props: LoginParams) => {
467
496
  handleCheckPhoneCode={handleCheckPhoneCode}
468
497
  setCheckPhoneCodeState={setCheckPhoneCodeState}
469
498
  handleVerifyCodeClick={handleVerifyCodeClick}
499
+ onClose={() => setIsModalVisible(false)}
470
500
  />
471
501
  </OModal>
472
502
  <Spinner visible={isFBLoading} />
@@ -2,7 +2,6 @@ import styled, { css } from 'styled-components/native';
2
2
 
3
3
  export const Container = styled.View`
4
4
  padding-bottom: 40px;
5
- padding-top: 24px;
6
5
  `
7
6
 
8
7
  export const FormSide = styled.View`
@@ -25,6 +24,7 @@ export const OTab = styled.View`
25
24
 
26
25
  export const LoginWith = styled.View`
27
26
  font-size: 14px;
27
+ padding-bottom: 10px;
28
28
  `;
29
29
 
30
30
  export const FormInput = styled.View`
@@ -56,7 +56,7 @@ export const OrSeparator = styled.View`
56
56
  flex-direction: row;
57
57
  justify-content: space-between;
58
58
  align-items: center;
59
- margin-bottom: 20px;
59
+ margin-bottom: 10px;
60
60
  `
61
61
 
62
62
  export const LineSeparator = styled.View`
@@ -69,10 +69,10 @@ export const SkeletonWrapper = styled.View`
69
69
  width: 90%;
70
70
  `
71
71
  export const InputWrapper = styled.View`
72
- flex-direction: row;
73
- align-items: flex-start;
74
- height: 40px;
75
- max-height: 40px;
76
- margin-vertical: 6px;
77
72
  justify-content: space-between;
73
+ flex-direction: row;
74
+ align-items: flex-start;
75
+ min-height: 40px;
76
+ max-height: 40px;
77
+ margin-vertical: 6px;
78
78
  `;
@@ -84,7 +84,7 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
84
84
  }, [userphoneNumber])
85
85
 
86
86
  return (
87
- <Wrapper>
87
+ <Wrapper style={props.wrapStyle}>
88
88
  <PhoneInput
89
89
  ref={phoneInput}
90
90
  defaultValue={userphoneNumber || defaultValue}
@@ -107,6 +107,7 @@ export interface PhoneInputParams {
107
107
  countryButtonStyle?: ViewStyle;
108
108
  textWrapStyle?: ViewStyle;
109
109
  renderDropImage?: any;
110
+ wrapStyle?: any;
110
111
  }
111
112
 
112
113
  export interface LanguageSelectorParams {
@@ -57,6 +57,7 @@ export const Home = (props: any) => {
57
57
  const loginProps = {
58
58
  navigation,
59
59
  useLoginByCellphone: true,
60
+ useLoginByEmail: true,
60
61
  loginButtonText: t('LOGIN', 'Login'),
61
62
  loginButtonBackground: theme.colors.primary,
62
63
  forgotButtonText: t('FORGOT_YOUR_PASSWORD', 'Forgot your password?'),
@@ -14,7 +14,8 @@ import {
14
14
  } from 'ordering-components/native';
15
15
 
16
16
  import { FacebookLogin } from '../FacebookLogin';
17
- import { VerifyPhone } from '../VerifyPhone';
17
+ import { VerifyPhone } from '../../../../../src/components/VerifyPhone';
18
+ import { OModal } from '../../../../../src/components/shared';
18
19
 
19
20
  import {
20
21
  Container,
@@ -33,7 +34,7 @@ import {
33
34
  import { _removeStoreData } from '../../providers/StoreUtil';
34
35
  import NavBar from '../NavBar'
35
36
 
36
- import { OText, OButton, OInput, OModal } from '../shared';
37
+ import { OText, OButton, OInput } from '../shared';
37
38
  import { LoginParams } from '../../types';
38
39
  import { useTheme } from 'styled-components/native';
39
40
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -362,24 +363,23 @@ const LoginFormUI = (props: LoginParams) => {
362
363
  </OrSeparator>
363
364
 
364
365
  {useLoginByCellphone &&
365
- loginTab === 'cellphone' &&
366
- configs && Object.keys(configs).length > 0 &&
367
- (configs?.twilio_service_enabled?.value === 'true' ||
368
- configs?.twilio_service_enabled?.value === '1') &&
366
+ loginTab === 'cellphone' &&
367
+ configs && Object.keys(configs).length > 0 &&
368
+ (configs?.twilio_service_enabled?.value === 'true' ||
369
+ configs?.twilio_service_enabled?.value === '1') &&
370
+ configs?.twilio_module?.value &&
369
371
  (
370
- <>
371
- <ButtonsWrapper mBottom={20}>
372
- <OButton
373
- onClick={handleVerifyCodeClick}
374
- text={t('GET_VERIFY_CODE', 'Get Verify Code')}
375
- borderColor={theme.colors.primary}
376
- style={loginStyle.btnOutline}
377
- imgRightSrc={null}
378
- isLoading={isLoadingVerifyModal}
379
- indicatorColor={theme.colors.primary}
380
- />
381
- </ButtonsWrapper>
382
- </>
372
+ <ButtonsWrapper mBottom={20}>
373
+ <OButton
374
+ onClick={handleVerifyCodeClick}
375
+ text={t('GET_VERIFY_CODE', 'Get Verify Code')}
376
+ borderColor={theme.colors.primary}
377
+ style={loginStyle.btnOutline}
378
+ imgRightSrc={null}
379
+ isLoading={isLoadingVerifyModal}
380
+ indicatorColor={theme.colors.primary}
381
+ />
382
+ </ButtonsWrapper>
383
383
  )
384
384
  }
385
385
 
@@ -417,6 +417,8 @@ const LoginFormUI = (props: LoginParams) => {
417
417
  <OModal
418
418
  open={isModalVisible}
419
419
  onClose={() => setIsModalVisible(false)}
420
+ entireModal
421
+ title={t('VERIFY_PHONE', 'Verify Phone')}
420
422
  >
421
423
  <VerifyPhone
422
424
  phone={phoneInputData.phone}
@@ -425,6 +427,7 @@ const LoginFormUI = (props: LoginParams) => {
425
427
  handleCheckPhoneCode={handleCheckPhoneCode}
426
428
  setCheckPhoneCodeState={setCheckPhoneCodeState}
427
429
  handleVerifyCodeClick={handleVerifyCodeClick}
430
+ onClose={() => setIsModalVisible(false)}
428
431
  />
429
432
  </OModal>
430
433
  <Spinner visible={isFBLoading} />
@@ -56,9 +56,7 @@ const BusinessMenu = (props:any): React.ReactElement => {
56
56
  clearTimeout(timerId.current);
57
57
  timerId.current = setTimeout(() => {
58
58
  setClearCart(true)
59
- navigation.reset({
60
- routes: [{ name: 'Intro' }],
61
- })
59
+ navigation.navigate('Intro')
62
60
  }, 60000*2);
63
61
  }, []);
64
62
 
@@ -1,14 +1,12 @@
1
1
  import React from 'react'
2
- import { View, StyleSheet } from 'react-native'
2
+ import { View, StyleSheet, ScrollView, TouchableOpacity } from 'react-native'
3
3
  import { BusinessAndProductList, useLanguage } from 'ordering-components/native'
4
- import Carousel from 'react-native-snap-carousel';
5
- import { BusinessProductsListingParams, Business, Product } from '../../types'
4
+ import { BusinessProductsListingParams, Business } from '../../types'
6
5
  import { OCard, OText, OIcon } from '../shared'
7
6
  import GridContainer from '../../layouts/GridContainer'
8
- import PromoCard from '../PromoCard';
9
7
  import Spinner from 'react-native-loading-spinner-overlay';
10
8
  import { LANDSCAPE, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
11
- import { useTheme } from 'styled-components/native';
9
+ import styled, { useTheme } from 'styled-components/native';
12
10
 
13
11
  const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
14
12
  const {navigation, businessState, resetInactivityTimeout, clearInactivityTimeout, bottomSheetVisibility } = props;
@@ -18,6 +16,27 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
18
16
  const theme = useTheme();
19
17
  const [, t] = useLanguage();
20
18
  const [orientationState] = useDeviceOrientation();
19
+ const WIDTH_SCREEN = orientationState?.dimensions?.width
20
+
21
+ const styles = StyleSheet.create({
22
+ logo: {
23
+ width: 500,
24
+ height: 400,
25
+ alignSelf: 'center',
26
+ },
27
+ soldOut: {
28
+ top: 0,
29
+ left: 0,
30
+ position: 'absolute',
31
+ width: WIDTH_SCREEN * 0.15,
32
+ height: 50,
33
+ justifyContent: 'center',
34
+ backgroundColor: theme.colors.white,
35
+ alignItems: 'center',
36
+ borderRadius: 15,
37
+ opacity: 0.8,
38
+ },
39
+ });
21
40
 
22
41
  const _categories: any = business?.original?.categories;
23
42
  let _promos: any = [];
@@ -39,13 +58,30 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
39
58
  </View>
40
59
  );
41
60
 
42
- const _renderItem = ({item, index}: {item: Product; index: number}) => {
61
+ const RenderCategories = ({ item, cardStyle, widthScreen }: any) => {
62
+ const Category = styled.ImageBackground`
63
+ position: relative;
64
+ height: 150px;
65
+ width: ${(props: any) => props.w * 0.45}px;
66
+ border-radius: 10px;
67
+ padding: 10px;
68
+ display: flex;
69
+ flex-direction: column;
70
+ justify-content: center;
71
+ align-items: center;
72
+ `
73
+ const WrapText = styled.View`
74
+ height: 90px;
75
+ display: flex;
76
+ justify-content: center;
77
+ align-items: center;
78
+ border-radius: 10px;
79
+ `
80
+
43
81
  return (
44
- <PromoCard
45
- title={item?.name}
46
- {...(!!item?.description && {description: item?.description})}
47
- image={{uri: item?.images}}
48
- isOutOfStock={!item?.inventoried}
82
+ <TouchableOpacity
83
+ key={item.id}
84
+ activeOpacity={1}
49
85
  onPress={() => {
50
86
  resetInactivityTimeout()
51
87
  navigation.navigate('ProductDetails', {
@@ -54,37 +90,71 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
54
90
  product: item,
55
91
  });
56
92
  }}
57
- />
58
- );
59
- };
60
-
61
- let _carousel: Carousel<Product> | null;
93
+ >
94
+ <Category
95
+ style={cardStyle}
96
+ source={{uri: item.images}}
97
+ resizeMode="cover"
98
+ w={widthScreen}
99
+ borderRadius={16}
100
+ >
101
+ {item?.inventoried && (
102
+ <View style={styles.soldOut}>
103
+ <OText size={28} color={theme.colors.error}>
104
+ {t('SOLD_OUT', 'SOLD OUT')}
105
+ </OText>
106
+ </View>
107
+ )}
108
+ <WrapText>
109
+ <OText
110
+ color={theme.colors.white}
111
+ mLeft={0}
112
+ size={32}
113
+ numberOfLines={1}
114
+ // mBottom={8}
115
+ style={{...props?.titleStyle}}
116
+ weight="bold"
117
+ >
118
+ {item.name}
119
+ </OText>
120
+ {!!item?.description && (
121
+ <OText
122
+ color={theme.colors.white}
123
+ numberOfLines={1}
124
+ // mBottom={4}
125
+ size={18}
126
+ style={{...props?.descriptionStyle}}
127
+ weight="400"
128
+ >
129
+ {item.description}
130
+ </OText>
131
+ )}
132
+ </WrapText>
133
+ </Category>
134
+ </TouchableOpacity>
135
+ )
136
+ }
62
137
 
63
138
  const _renderPromos = (): React.ReactElement => (
64
139
  <>
65
140
  {_renderTitle(t('FEATURED', 'Featured'))}
66
- <Carousel
67
- keyExtractor={(item: any) => item.id}
68
- ref={(c: any) => {
69
- _carousel = c;
70
- }}
71
- data={_promos || []}
72
- renderItem={_renderItem}
73
- sliderWidth={orientationState?.dimensions?.width}
74
- itemWidth={orientationState?.dimensions?.width * 0.4}
75
- alwaysBounceHorizontal={false}
76
- slideStyle={{
77
- width: orientationState?.dimensions?.width * 0.45,
78
- marginLeft: 20,
79
- }}
80
- inactiveSlideScale={1}
81
- snapToAlignment="start"
82
- activeSlideAlignment="start"
83
- inactiveSlideOpacity={1}
84
- initialScrollIndex={0}
85
- onScrollToIndexFailed={(_: any) => {}}
86
- enableMomentum={true}
87
- />
141
+ <View style={{ paddingVertical: 20, marginLeft: 20, width: '100%' }}>
142
+ <ScrollView
143
+ horizontal
144
+ showsHorizontalScrollIndicator={false}
145
+ showsVerticalScrollIndicator={false}
146
+ style={{ width: '100%' }}
147
+ >
148
+ {_promos.map((category: any) => (
149
+ <RenderCategories
150
+ key={category.id}
151
+ item={category}
152
+ widthScreen={WIDTH_SCREEN}
153
+ cardStyle={{ marginRight: 20 }}
154
+ />
155
+ ))}
156
+ </ScrollView>
157
+ </View>
88
158
  </>
89
159
  );
90
160
 
@@ -148,23 +218,6 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
148
218
  );
149
219
  };
150
220
 
151
- const styles = StyleSheet.create({
152
- logo: {
153
- width: 500,
154
- height: 400,
155
- alignSelf: 'center',
156
- },
157
- wrapper: {
158
- display: 'flex',
159
- flex: 1,
160
- flexDirection: 'column',
161
- justifyContent: 'center',
162
- alignItems: 'center',
163
- height: '100%',
164
- backgroundColor: 'yellow'
165
- },
166
- });
167
-
168
221
  export const BusinessProductsListing = (props: any) => {
169
222
  const businessProductslistingProps = {
170
223
  ...props,
@@ -3,7 +3,7 @@ import styled from 'styled-components/native'
3
3
  import { OIcon, OButton, OText } from '../shared'
4
4
  import { ImageStyle, TextStyle, View, Platform } from 'react-native'
5
5
  import { OrderTypeSelector } from '../OrderTypeSelector'
6
- import { useConfig } from 'ordering-components/native'
6
+ import { useConfig, useLanguage } from 'ordering-components/native'
7
7
  import { useTheme } from 'styled-components/native'
8
8
 
9
9
  const Wrapper = styled.View`
@@ -60,6 +60,7 @@ interface Props {
60
60
  const NavBar = (props: Props) => {
61
61
  const theme = useTheme();
62
62
  const [{ configs }] = useConfig();
63
+ const [, t] = useLanguage();
63
64
  const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || [];
64
65
 
65
66
  return (
@@ -113,7 +114,13 @@ const NavBar = (props: Props) => {
113
114
  </TitleTopWrapper>
114
115
 
115
116
  {props?.includeOrderTypeSelector && (
116
- <View style={{ paddingHorizontal: props.rightComponent ? 4 : 20 }}>
117
+ <View
118
+ style={{
119
+ paddingHorizontal: props.rightComponent ? 4 : 20,
120
+ flexDirection: 'row'
121
+ }}
122
+ >
123
+ <OText style={{ paddingRight: 5 }}>{t('THIS_ORDER_IS_TO', 'This order is to')}</OText>
117
124
  <OrderTypeSelector configTypes={configTypes} />
118
125
  </View>
119
126
  )}
@@ -85,11 +85,11 @@ export const OrderTypeSelector = (props: any) => {
85
85
  orderTypes: props.orderType || [
86
86
  {
87
87
  value: 2,
88
- content: `${t('THIS_ORDER_IS_TO', 'This order is to')} ${t('TAKE_OUT', 'Take out')}`
88
+ content: t('TAKE_OUT', 'Take out')
89
89
  },
90
90
  {
91
91
  value: 3,
92
- content: `${t('THIS_ORDER_IS_TO', 'This order is to')} ${t('EAT_IN', 'Eat in')}`
92
+ content: t('EAT_IN', 'Eat in')
93
93
  },
94
94
  ]
95
95
  }
@@ -365,9 +365,9 @@ export const ProductOptionsUI = (props: any) => {
365
365
  </Animated.View>
366
366
  </Animated.View>
367
367
 
368
- {!isFromCheckout && (
368
+ {/* {!isFromCheckout && (
369
369
  <Spinner visible={loading} />
370
- )}
370
+ )} */}
371
371
  {!loading && !error && product && (
372
372
  <View style={{ paddingTop: isDrawer ? 10 : 20, paddingBottom: 80 }}>
373
373
  <WrapContent isDrawer={isDrawer}>
@@ -44,7 +44,7 @@ const OCard = (props: Props): React.ReactElement => {
44
44
  )}
45
45
  <OImage
46
46
  source={props.image}
47
- height={Platform.OS === 'ios' ? 250 : 150}
47
+ height={120}
48
48
  resizeMode="cover"
49
49
  borderRadius={16}
50
50
  />
@@ -15,6 +15,8 @@ export interface BusinessProductsListingParams {
15
15
  resetInactivityTimeout: any;
16
16
  clearInactivityTimeout: any;
17
17
  bottomSheetVisibility: any;
18
+ titleStyle: any;
19
+ descriptionStyle: any;
18
20
  }
19
21
 
20
22
  export interface OrderDetailsParams {
@@ -15,7 +15,9 @@ import {
15
15
  } from 'ordering-components/native';
16
16
  import { useTheme } from 'styled-components/native';
17
17
  import { FacebookLogin } from '../FacebookLogin';
18
- import { VerifyPhone } from '../VerifyPhone';
18
+ import { VerifyPhone } from '../../../../../src/components/VerifyPhone';
19
+ import { OModal } from '../../../../../src/components/shared';
20
+
19
21
 
20
22
  import {
21
23
  Container,
@@ -34,7 +36,7 @@ import {
34
36
 
35
37
  import NavBar from '../NavBar';
36
38
 
37
- import { OText, OButton, OInput, OModal, OIcon } from '../shared';
39
+ import { OText, OButton, OInput, OIcon } from '../shared';
38
40
  import { LoginParams } from '../../types';
39
41
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
40
42
  import { GoogleLogin } from '../GoogleLogin';
@@ -406,11 +408,11 @@ const LoginFormUI = (props: LoginParams) => {
406
408
  )}
407
409
 
408
410
  {useLoginByCellphone &&
409
- loginTab === 'cellphone' &&
410
- configs &&
411
- Object.keys(configs).length > 0 &&
412
- (configs?.twilio_service_enabled?.value === 'true' ||
413
- configs?.twilio_service_enabled?.value === '1') && (
411
+ loginTab === 'cellphone' &&
412
+ configs && Object.keys(configs).length > 0 &&
413
+ (configs?.twilio_service_enabled?.value === 'true' ||
414
+ configs?.twilio_service_enabled?.value === '1') &&
415
+ configs?.twilio_module?.value && (
414
416
  <>
415
417
  <OrSeparator>
416
418
  <LineSeparator />
@@ -515,7 +517,12 @@ const LoginFormUI = (props: LoginParams) => {
515
517
  </ButtonsWrapper>
516
518
  )} */}
517
519
  </FormSide>
518
- <OModal open={isModalVisible} onClose={() => setIsModalVisible(false)}>
520
+ <OModal
521
+ open={isModalVisible}
522
+ onClose={() => setIsModalVisible(false)}
523
+ entireModal
524
+ title={t('VERIFY_PHONE', 'Verify Phone')}
525
+ >
519
526
  <VerifyPhone
520
527
  phone={phoneInputData.phone}
521
528
  verifyPhoneState={verifyPhoneState}
@@ -523,6 +530,7 @@ const LoginFormUI = (props: LoginParams) => {
523
530
  handleCheckPhoneCode={handleCheckPhoneCode}
524
531
  setCheckPhoneCodeState={setCheckPhoneCodeState}
525
532
  handleVerifyCodeClick={handleVerifyCodeClick}
533
+ onClose={() => setIsModalVisible(false)}
526
534
  />
527
535
  </OModal>
528
536
  <Spinner visible={isFBLoading} />
@@ -239,9 +239,9 @@ const CartUI = (props: any) => {
239
239
  </OSTotal>
240
240
  {cart?.status !== 2 && (
241
241
  <OSTable>
242
- <View style={{ width: '100%', marginTop: 20 }}>
242
+ <View style={{ flex: 1, marginTop: 20, paddingBottom: 20 }}>
243
243
  <OText>{t('COMMENTS', 'Comments')}</OText>
244
- <View style={{ flex: 1, width: '100%' }}>
244
+ <View style={{ flex: 1 }}>
245
245
  <OInput
246
246
  value={cart?.comment}
247
247
  placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
@@ -6,7 +6,7 @@ export const CContainer = styled.View`
6
6
 
7
7
  export const CartContent = styled.View`
8
8
  ${((props: any) => props.isBusinessCart && css`
9
- margin-bottom: 45px;
9
+ margin-bottom: 65px;
10
10
  `)}
11
11
  `
12
12
 
@@ -15,7 +15,8 @@ import {
15
15
  } from 'ordering-components/native';
16
16
 
17
17
  import { FacebookLogin } from '../FacebookLogin';
18
- import { VerifyPhone } from '../VerifyPhone';
18
+ import { VerifyPhone } from '../../../../../src/components/VerifyPhone';
19
+ import { OModal } from '../../../../../src/components/shared';
19
20
 
20
21
  import {
21
22
  Container,
@@ -33,7 +34,7 @@ import {
33
34
  import { _removeStoreData } from '../../providers/StoreUtil';
34
35
  import NavBar from '../NavBar'
35
36
 
36
- import { OText, OButton, OInput, OModal } from '../shared';
37
+ import { OText, OButton, OInput } from '../shared';
37
38
  import { LoginParams } from '../../types';
38
39
  import { useTheme } from 'styled-components/native';
39
40
 
@@ -363,6 +364,7 @@ const LoginFormUI = (props: LoginParams) => {
363
364
  configs && Object.keys(configs).length > 0 &&
364
365
  (configs?.twilio_service_enabled?.value === 'true' ||
365
366
  configs?.twilio_service_enabled?.value === '1') &&
367
+ configs?.twilio_module?.value &&
366
368
  (
367
369
  <>
368
370
  <OrSeparator>
@@ -409,6 +411,8 @@ const LoginFormUI = (props: LoginParams) => {
409
411
  <OModal
410
412
  open={isModalVisible}
411
413
  onClose={() => setIsModalVisible(false)}
414
+ entireModal
415
+ title={t('VERIFY_PHONE', 'Verify Phone')}
412
416
  >
413
417
  <VerifyPhone
414
418
  phone={phoneInputData.phone}
@@ -417,6 +421,7 @@ const LoginFormUI = (props: LoginParams) => {
417
421
  handleCheckPhoneCode={handleCheckPhoneCode}
418
422
  setCheckPhoneCodeState={setCheckPhoneCodeState}
419
423
  handleVerifyCodeClick={handleVerifyCodeClick}
424
+ onClose={() => setIsModalVisible(false)}
420
425
  />
421
426
  </OModal>
422
427
  <Spinner visible={isFBLoading} />
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
- import { Modal, TouchableWithoutFeedback, Dimensions, StyleSheet, View, ScrollView, Text } from 'react-native'
2
+ import { Modal, TouchableWithoutFeedback, Dimensions, StyleSheet, View, ScrollView, Text, Platform } from 'react-native'
3
3
  import { OText } from '../shared'
4
4
  import Icon from 'react-native-vector-icons/Feather'
5
- import { useTheme } from 'styled-components/native'
5
+ import styled,{ useTheme } from 'styled-components/native'
6
6
 
7
7
  const deviceHeight = Dimensions.get('window').height
8
8
 
@@ -24,6 +24,11 @@ const OBottomPopup = (props: Props) => {
24
24
 
25
25
  const theme = useTheme()
26
26
 
27
+ const KeyboardView = styled.KeyboardAvoidingView`
28
+ flex-grow: 1;
29
+ flex-shrink: 1;
30
+ `;
31
+
27
32
  const styles = StyleSheet.create({
28
33
  container: {
29
34
  flex: 1,
@@ -79,26 +84,31 @@ const OBottomPopup = (props: Props) => {
79
84
  <View style={styles.touchableOutsideStyle} />
80
85
  </TouchableWithoutFeedback>
81
86
  <View style={styles.bottomContainer}>
82
- <ScrollView showsVerticalScrollIndicator={false}>
83
- {customHeaderShow ? (
84
- <View style={styles.customHeaderStyle}>
85
- <OText size={16} numberOfLines={1} style={styles.customTitleStyle}>
87
+ <KeyboardView
88
+ enabled
89
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
90
+ >
91
+ <ScrollView showsVerticalScrollIndicator={false} >
92
+ {customHeaderShow ? (
93
+ <View style={styles.customHeaderStyle}>
94
+ <OText size={16} numberOfLines={1} style={styles.customTitleStyle}>
95
+ {title}
96
+ </OText>
97
+ <Icon
98
+ name='x'
99
+ size={30}
100
+ style={styles.closeBtnStyle}
101
+ onPress={onClose}
102
+ />
103
+ </View>
104
+ ) : (
105
+ <Text style={styles.titleStyle}>
86
106
  {title}
87
- </OText>
88
- <Icon
89
- name='x'
90
- size={30}
91
- style={styles.closeBtnStyle}
92
- onPress={onClose}
93
- />
94
- </View>
95
- ) : (
96
- <Text style={styles.titleStyle}>
97
- {title}
98
- </Text>
99
- )}
100
- {children}
101
- </ScrollView>
107
+ </Text>
108
+ )}
109
+ {children}
110
+ </ScrollView>
111
+ </KeyboardView>
102
112
  </View>
103
113
  </View>
104
114
  </Modal>