ordering-ui-react-native 0.11.54 → 0.11.58

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 (47) hide show
  1. package/package.json +1 -1
  2. package/src/components/OrderCreating/index.tsx +8 -4
  3. package/src/config.json +1 -1
  4. package/themes/instacart/index.tsx +4 -0
  5. package/themes/instacart/src/components/BusinessItemAccordion/index.tsx +16 -41
  6. package/themes/instacart/src/components/BusinessItemAccordion/styles.tsx +4 -6
  7. package/themes/instacart/src/components/BusinessesListing/index.tsx +2 -2
  8. package/themes/instacart/src/components/Cart/index.tsx +8 -5
  9. package/themes/instacart/src/components/Cart/styles.tsx +11 -0
  10. package/themes/instacart/src/components/CartContent/index.tsx +2 -1
  11. package/themes/instacart/src/components/NavBar/index.tsx +4 -2
  12. package/themes/instacart/src/components/PreviousOrders/index.tsx +1 -1
  13. package/themes/instacart/src/components/ReviewDriver/index.tsx +221 -0
  14. package/themes/instacart/src/components/ReviewDriver/styles.tsx +46 -0
  15. package/themes/instacart/src/components/ReviewOrder/index.tsx +304 -185
  16. package/themes/instacart/src/components/ReviewOrder/styles.tsx +18 -3
  17. package/themes/instacart/src/components/ReviewProduct/index.tsx +275 -0
  18. package/themes/instacart/src/components/ReviewProduct/styles.tsx +53 -0
  19. package/themes/instacart/src/components/SingleProductCard/index.tsx +8 -8
  20. package/themes/instacart/src/components/SingleProductCard/styles.tsx +4 -5
  21. package/themes/instacart/src/components/TagSelector/index.tsx +94 -0
  22. package/themes/instacart/src/components/TagSelector/styles.ts +0 -0
  23. package/themes/instacart/src/components/shared/OBottomStickBar.tsx +62 -0
  24. package/themes/instacart/src/config/constants.tsx +25 -1
  25. package/themes/instacart/src/types/index.tsx +25 -2
  26. package/themes/original/src/components/AddressForm/index.tsx +6 -2
  27. package/themes/original/src/components/FloatingButton/index.tsx +3 -2
  28. package/themes/original/src/components/FloatingButton/styles.tsx +2 -2
  29. package/themes/original/src/components/LoginForm/index.tsx +7 -2
  30. package/themes/original/src/components/ProductForm/index.tsx +5 -1
  31. package/themes/original/src/components/ProductForm/styles.tsx +3 -1
  32. package/themes/original/src/components/SignupForm/index.tsx +7 -2
  33. package/themes/original/src/components/UserDetails/index.tsx +3 -2
  34. package/themes/original/src/components/UserFormDetails/styles.tsx +0 -1
  35. package/themes/original/src/components/shared/OInput.tsx +1 -0
  36. package/themes/original/src/layouts/Container.tsx +4 -1
  37. package/themes/single-business/src/components/Checkout/index.tsx +2 -2
  38. package/themes/single-business/src/components/ForgotPasswordForm/index.tsx +2 -2
  39. package/themes/single-business/src/components/LastOrder/index.tsx +1 -1
  40. package/themes/single-business/src/components/LoginForm/index.tsx +1 -1
  41. package/themes/single-business/src/components/ReviewOrder/index.tsx +1 -1
  42. package/themes/single-business/src/components/SignupForm/index.tsx +1 -1
  43. package/themes/single-business/src/components/StripeRedirectForm/index.tsx +1 -1
  44. package/themes/single-business/src/components/UserFormDetails/index.tsx +1 -1
  45. package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
  46. package/themes/single-business/src/components/UserProfileForm/index.tsx +1 -1
  47. package/themes/single-business/src/components/shared/OToast.tsx +1 -1
@@ -58,6 +58,7 @@ const LoginFormUI = (props: LoginParams) => {
58
58
  handleSendVerifyCode,
59
59
  handleCheckPhoneCode,
60
60
  onNavigationRedirect,
61
+ notificationState
61
62
  } = props;
62
63
 
63
64
  const [, { showToast }] = useToast();
@@ -461,6 +462,7 @@ const LoginFormUI = (props: LoginParams) => {
461
462
  {(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
462
463
  configs?.facebook_id?.value && (
463
464
  <FacebookLogin
465
+ notificationState={notificationState}
464
466
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
465
467
  handleLoading={(val: boolean) => setIsFBLoading(val)}
466
468
  handleSuccessFacebookLogin={handleSuccessFacebook}
@@ -468,16 +470,19 @@ const LoginFormUI = (props: LoginParams) => {
468
470
  )}
469
471
  {(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
470
472
  <GoogleLogin
473
+ notificationState={notificationState}
474
+ webClientId={configs?.google_login_client_id?.value}
471
475
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
472
476
  handleLoading={(val: boolean) => setIsFBLoading(val)}
473
- handleSuccessFacebookLogin={handleSuccessFacebook}
477
+ handleSuccessGoogleLogin={handleSuccessFacebook}
474
478
  />
475
479
  )}
476
480
  {(configs?.apple_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
477
481
  <AppleLogin
482
+ notificationState={notificationState}
478
483
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
479
484
  handleLoading={(val: boolean) => setIsFBLoading(val)}
480
- handleSuccessFacebookLogin={handleSuccessFacebook}
485
+ handleSuccessAppleLogin={handleSuccessFacebook}
481
486
  />
482
487
  )}
483
488
  </SocialButtons>
@@ -569,7 +569,11 @@ export const ProductOptionsUI = (props: any) => {
569
569
  )}
570
570
  </ScrollView>
571
571
  {!loading && !error && product && (
572
- <ProductActions style={{ paddingBottom: bottom + 12 }}>
572
+ <ProductActions
573
+ style={{
574
+ paddingBottom: Platform.OS === 'ios' ? bottom + 30 : bottom + 80
575
+ }}
576
+ >
573
577
  <OText size={16} lineHeight={24} weight={'600'}>
574
578
  {productCart.total ? parsePrice(productCart?.total) : ''}
575
579
  </OText>
@@ -57,13 +57,15 @@ export const WrapperSubOption = styled.View`
57
57
  `
58
58
 
59
59
  export const ProductComment = styled.View`
60
+ padding-bottom: 50px;
60
61
  `
61
62
 
62
63
  export const ProductActions = styled.View`
63
64
  position: absolute;
64
65
  bottom: 0px;
65
66
  min-height: 70px;
66
- padding: 12px 40px;
67
+ padding-top: 12px;
68
+ padding-horizontal: 40px;
67
69
  width: 100%;
68
70
  flex-direction: row;
69
71
  background-color: #FFF;
@@ -62,6 +62,7 @@ const SignupFormUI = (props: SignupParams) => {
62
62
  setCheckPhoneCodeState,
63
63
  handleSendVerifyCode,
64
64
  handleCheckPhoneCode,
65
+ notificationState
65
66
  } = props;
66
67
 
67
68
  const theme = useTheme();
@@ -637,6 +638,7 @@ const SignupFormUI = (props: SignupParams) => {
637
638
  {(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
638
639
  configs?.facebook_id?.value && (
639
640
  <FacebookLogin
641
+ notificationState={notificationState}
640
642
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
641
643
  handleLoading={(val: boolean) => setIsFBLoading(val)}
642
644
  handleSuccessFacebookLogin={handleSuccessFacebook}
@@ -644,16 +646,19 @@ const SignupFormUI = (props: SignupParams) => {
644
646
  )}
645
647
  {(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
646
648
  <GoogleLogin
649
+ notificationState={notificationState}
650
+ webClientId={configs?.google_login_client_id?.value}
647
651
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
648
652
  handleLoading={(val: boolean) => setIsFBLoading(val)}
649
- handleSuccessFacebookLogin={handleSuccessFacebook}
653
+ handleSuccessGoogleLogin={handleSuccessFacebook}
650
654
  />
651
655
  )}
652
656
  {(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && (
653
657
  <AppleLogin
658
+ notificationState={notificationState}
654
659
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
655
660
  handleLoading={(val: boolean) => setIsFBLoading(val)}
656
- handleSuccessFacebookLogin={handleSuccessFacebook}
661
+ handleSuccessAppleLogin={handleSuccessFacebook}
657
662
  />
658
663
  )}
659
664
  </SocialButtons>
@@ -25,7 +25,8 @@ const UserDetailsUI = (props: any) => {
25
25
  validationFields,
26
26
  isUserDetailsEdit,
27
27
  phoneUpdate,
28
- togglePhoneUpdate
28
+ togglePhoneUpdate,
29
+ isCheckout
29
30
  } = props
30
31
 
31
32
  const theme = useTheme();
@@ -116,7 +117,7 @@ const UserDetailsUI = (props: any) => {
116
117
  )}
117
118
  </UDInfo>
118
119
  ) : (
119
- <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} />
120
+ <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} isCheckout={isCheckout} />
120
121
  )}
121
122
  </UDContainer>
122
123
  )}
@@ -14,7 +14,6 @@ export const UDWrapper = styled.View`
14
14
  flex-direction: column;
15
15
  width: 100%;
16
16
  margin-top: 20px;
17
- padding-bottom: 50px;
18
17
  `
19
18
 
20
19
  export const UDLoader = styled.View`
@@ -48,6 +48,7 @@ const Wrapper = styled.View`
48
48
  flex-direction: row;
49
49
  align-items: center;
50
50
  justify-content: center;
51
+ width: 100%;
51
52
  `;
52
53
 
53
54
  const OInput = (props: Props): React.ReactElement => {
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
2
  import styled, { css } from 'styled-components/native';
3
+ import { Platform } from 'react-native';
3
4
 
4
5
  const ContainerStyled = styled.ScrollView`
5
6
  flex: 1;
6
- padding: ${(props: any) => props.noPadding ? '0' : '0 40px'};
7
+ ${(props: any) => !props.noPadding && css`
8
+ padding: ${Platform.OS === 'ios' ? '0px 40px' : '20px 40px'};
9
+ `}
7
10
  background-color: ${(props: any) => props.theme.colors.backgroundPage};
8
11
  `;
9
12
 
@@ -96,7 +96,7 @@ const CheckoutUI = (props: any) => {
96
96
  }
97
97
  })
98
98
 
99
- const { showToast } = useToast();
99
+ const [, { showToast }] = useToast();
100
100
  const [, t] = useLanguage();
101
101
  const [{ user }] = useSession();
102
102
  const [{ configs }] = useConfig();
@@ -513,7 +513,7 @@ export const Checkout = (props: any) => {
513
513
  onNavigationRedirect,
514
514
  } = props
515
515
 
516
- const { showToast } = useToast();
516
+ const [, { showToast }] = useToast();
517
517
  const [, t] = useLanguage();
518
518
  const [{ token }] = useSession();
519
519
  const [ordering] = useApi();
@@ -22,7 +22,7 @@ const ForgotPasswordUI = (props: any) => {
22
22
  handleButtonForgotPasswordClick,
23
23
  } = props;
24
24
  const [, t] = useLanguage();
25
- const { showToast } = useToast();
25
+ const [, { showToast }] = useToast();
26
26
  const { control, handleSubmit, errors } = useForm();
27
27
 
28
28
  const theme = useTheme();
@@ -31,7 +31,7 @@ const ForgotPasswordUI = (props: any) => {
31
31
  inputStyle: {
32
32
  marginBottom: 25,
33
33
  borderWidth: 1,
34
- borderColor: theme.theme.colors.border,
34
+ borderColor: theme.colors.border,
35
35
  minHeight: 40,
36
36
  borderRadius: 7.6,
37
37
  }
@@ -32,7 +32,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
32
32
 
33
33
  const [, t] = useLanguage()
34
34
  const [, { reorder }] = useOrder()
35
- const { showToast } = useToast()
35
+ const [, { showToast }] = useToast()
36
36
  const { loading, error, orders: values } = orderList
37
37
 
38
38
  const theme = useTheme();
@@ -58,7 +58,7 @@ const LoginFormUI = (props: LoginParams) => {
58
58
  onNavigationRedirect,
59
59
  } = props;
60
60
 
61
- const { showToast } = useToast();
61
+ const [, { showToast }] = useToast();
62
62
  const [, t] = useLanguage();
63
63
  const [{ configs }] = useConfig();
64
64
  const [, { login }] = useSession();
@@ -60,7 +60,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
60
60
  })
61
61
 
62
62
  const [, t] = useLanguage()
63
- const { showToast } = useToast()
63
+ const [, { showToast }] = useToast()
64
64
  const { handleSubmit, control, errors } = useForm()
65
65
 
66
66
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
@@ -95,7 +95,7 @@ const SignupFormUI = (props: SignupParams) => {
95
95
  const showInputPhoneNumber =
96
96
  validationFields?.fields?.checkout?.cellphone?.enabled ?? false;
97
97
 
98
- const { showToast } = useToast();
98
+ const [, { showToast }] = useToast();
99
99
  const [, t] = useLanguage();
100
100
  const [, { login }] = useSession();
101
101
  const [{ configs }] = useConfig();
@@ -26,7 +26,7 @@ const StripeRedirectFormUI = (props: any) => {
26
26
  // // androidPayMode: 'test', // Android only
27
27
  // })
28
28
 
29
- const { showToast } = useToast();
29
+ const [, { showToast }] = useToast();
30
30
  const { control, handleSubmit, errors } = useForm();
31
31
 
32
32
  const [{ user }] = useSession();
@@ -62,7 +62,7 @@ export const UserFormDetailsUI = (props: any) => {
62
62
  });
63
63
 
64
64
  const [, t] = useLanguage();
65
- const { showToast } = useToast();
65
+ const [, { showToast }] = useToast();
66
66
  const { handleSubmit, control, errors, setValue } = useForm();
67
67
 
68
68
  const [{ user }] = useSession();
@@ -84,7 +84,7 @@ const ProfileListUI = (props: ProfileParams) => {
84
84
 
85
85
  const [{ user }] = useSession();
86
86
  const [, t] = useLanguage();
87
- const { showToast } = useToast();
87
+ const [, { showToast }] = useToast();
88
88
  const { errors } = useForm();
89
89
 
90
90
  const { height } = useWindowDimensions();
@@ -52,7 +52,7 @@ const ProfileUI = (props: ProfileParams) => {
52
52
 
53
53
  const [{ user }] = useSession();
54
54
  const [, t] = useLanguage();
55
- const { showToast } = useToast();
55
+ const [, { showToast }] = useToast();
56
56
  const { handleSubmit, errors, setValue, control } = useForm();
57
57
 
58
58
  const [phoneInputData, setPhoneInputData] = useState({
@@ -9,7 +9,7 @@ const bottomPosition = 20;
9
9
  export const Toast: React.FC = () => {
10
10
  const theme = useTheme();
11
11
  // const insets = useSafeAreaInsets();
12
- const { toastConfig, hideToast } = useToast();
12
+ const [, { toastConfig, hideToast }] = useToast();
13
13
  const opacity = React.useRef(new Animated.Value(0)).current;
14
14
 
15
15
  const fadeIn = React.useCallback(() => {