ordering-ui-react-native 0.12.57 → 0.12.61

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 (182) hide show
  1. package/package.json +1 -1
  2. package/src/components/AppleLogin/index.tsx +14 -8
  3. package/themes/doordash/src/components/Cart/index.tsx +1 -0
  4. package/themes/doordash/src/components/LastOrders/index.tsx +1 -1
  5. package/themes/doordash/src/components/OrderSummary/index.tsx +1 -0
  6. package/themes/instacart/src/components/OrderDetails/index.tsx +2 -2
  7. package/themes/single-business/src/components/Cart/index.tsx +127 -16
  8. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  9. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  10. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  11. package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
  12. package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
  13. package/themes/franchises/index.tsx +0 -111
  14. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  15. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  16. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  17. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  18. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  19. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  20. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  21. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  22. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  23. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  24. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  25. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  26. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  27. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  28. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  29. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  30. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  31. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  32. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  33. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  34. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  35. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  36. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  37. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  38. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  39. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  40. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  41. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  42. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  43. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  44. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  45. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  46. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  47. package/themes/franchises/src/components/Cart/index.tsx +0 -332
  48. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  49. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  50. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  51. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  52. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  53. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  54. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  55. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  56. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  57. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  58. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  59. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  60. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  61. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  62. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  63. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  64. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  65. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  66. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  67. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  68. package/themes/franchises/src/components/Help/index.tsx +0 -56
  69. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  70. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  71. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  72. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  73. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  74. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  75. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  76. package/themes/franchises/src/components/Home/index.tsx +0 -102
  77. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  78. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  79. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  80. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  81. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  82. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  83. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  84. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  85. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  86. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  87. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  88. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  89. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  90. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  91. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  92. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  93. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  94. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  95. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  96. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -828
  97. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  98. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -266
  99. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  100. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  101. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  102. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  103. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  104. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  105. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  106. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  107. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  108. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  109. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  110. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  111. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  112. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  113. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  114. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  115. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  116. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  117. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  118. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  119. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  120. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  121. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  122. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  123. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  124. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  125. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  126. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  127. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  128. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  129. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  130. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  131. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  132. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  133. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  134. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  135. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  136. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  137. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  138. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  139. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  140. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  141. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  142. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  143. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  144. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  145. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  146. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  147. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  148. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  149. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  150. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  151. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  152. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  153. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  154. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  155. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  156. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  157. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  158. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  159. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  160. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  161. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  162. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  163. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  164. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  165. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  166. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  167. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  168. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  169. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  170. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  171. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  172. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  173. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  174. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  175. package/themes/franchises/src/components/shared/index.tsx +0 -29
  176. package/themes/franchises/src/config/constants.tsx +0 -57
  177. package/themes/franchises/src/layouts/Container.tsx +0 -23
  178. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  179. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  180. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  181. package/themes/franchises/src/types/index.tsx +0 -445
  182. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -1,89 +0,0 @@
1
- import { Platform } from 'react-native';
2
- import styled, { css } from 'styled-components/native';
3
-
4
- export const ChContainer = styled.View`
5
- margin-bottom: 60px;
6
- `
7
-
8
- export const ChSection = styled.View`
9
- padding-top: 30px;
10
- `
11
-
12
- export const ChHeader = styled.View`
13
- justify-content: flex-start;
14
- flex-direction: row;
15
- align-items: center;
16
- margin: 0px;
17
- `
18
-
19
- export const ChTotal = styled.View`
20
- background-color: ${(props: any) => props.theme.colors.inputDisabled};
21
- padding: 10px 20px;
22
- display: flex;
23
- justify-content: space-between;
24
- flex-direction: row;
25
- align-items: center;
26
- `
27
-
28
- export const ChTotalWrap = styled.View`
29
- display: flex;
30
- flex-direction: row;
31
- align-items: center;
32
- `
33
-
34
- export const ChAddress = styled.View`
35
- width: 100%;
36
- `
37
-
38
- export const ChMoment = styled(ChAddress)`
39
- padding: 0 0 20px;
40
- `
41
-
42
- export const CHDropBtnWrapper = styled.TouchableOpacity`
43
- background-color: ${(props: any) => props.theme.colors.backgroundGray100};
44
- border-radius: 7.6px;
45
- font-size: 12px;
46
- max-width: 240px;
47
- height: 26px;
48
- align-items: center;
49
- justify-content: center;
50
- padding-horizontal: 8px;
51
- flex-direction: row;
52
- margin-end: 12px;
53
- `
54
-
55
- export const ChUserDetails = styled.View`
56
- display: flex;
57
- justify-content: center;
58
- flex-direction: column;
59
- width: 100%;
60
- padding-bottom: 34px;
61
- `
62
-
63
- export const ChBusinessDetails = styled(ChUserDetails)`
64
- padding-top: 0;
65
- `
66
-
67
- export const ChPaymethods = styled.View`
68
- display: flex;
69
- flex-direction: column;
70
- padding: 0 0 20px;
71
- `
72
-
73
- export const ChDriverTips = styled(ChPaymethods)``
74
-
75
- export const ChCart = styled(ChPaymethods)``
76
-
77
- export const ChPlaceOrderBtn = styled.View`
78
- width: 100%;
79
- display: flex;
80
- justify-content: center;
81
- `
82
-
83
- export const ChErrors = styled.View`
84
- display: flex;
85
- justify-content: center;
86
- flex-direction: column;
87
- align-items: center;
88
- margin-bottom: 20px;
89
- `
@@ -1,119 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import { StyleSheet, Alert, Text } from 'react-native';
3
- import { CouponControl as CouponController, useLanguage } from 'ordering-components/native';
4
- import { useTheme } from 'styled-components/native';
5
- import {
6
- CContainer,
7
- CCWrapper,
8
- CCButton
9
- } from './styles';
10
-
11
- import { OInput, OButton, OAlert, OText } from '../shared';
12
-
13
- const CouponControlUI = (props: any) => {
14
- const {
15
- couponDefault,
16
- couponInput,
17
- handleButtonApplyClick,
18
- handleRemoveCouponClick,
19
- onChangeInputCoupon,
20
- confirm,
21
- setConfirm
22
- } = props
23
-
24
- const [, t] = useLanguage()
25
- const theme = useTheme();
26
-
27
- const styles = StyleSheet.create({
28
- inputsStyle: {
29
- borderColor: theme.colors.border,
30
- borderRadius: 7.6,
31
- flex: 1,
32
- marginRight: 20,
33
- height: 44
34
- },
35
- });
36
-
37
- const handleOnAccept = () => {
38
- if (!confirm.error) {
39
- handleRemoveCouponClick && handleRemoveCouponClick()
40
- }
41
- onChangeInputCoupon('')
42
- }
43
-
44
- const cleanSetConfirm = () => {
45
- setConfirm({ ...confirm, open: false, error: false })
46
- }
47
-
48
- useEffect(() => {
49
- if (confirm.content) {
50
- Alert.alert(
51
- t('COUPON_ERROR', 'Coupon Error'),
52
- confirm.content[0],
53
- [
54
- {
55
- text: t('CANCEL', 'cancel'),
56
- onPress: () => cleanSetConfirm(),
57
- style: 'cancel'
58
- },
59
- {
60
- text: t('ACCEPT', 'Accept'),
61
- onPress: () => cleanSetConfirm()
62
- }
63
- ],
64
- { cancelable: false }
65
- )
66
- }
67
- }, [confirm])
68
-
69
- return (
70
- <CContainer>
71
- {couponDefault ? (
72
- <OAlert
73
- title={t('REMOVE_COUPON', 'Remove Coupon')}
74
- message={t('QUESTION_DELETE_COUPON', 'Are you sure that you want to delete the coupon?')}
75
- onAccept={() => handleOnAccept()}
76
- >
77
- <CCButton>
78
- <OText
79
- size={12}
80
- color={theme.colors.white}
81
- style={{ textAlign: 'center' }}
82
- >
83
- {`${t('REMOVE_COUPON', 'Remove Coupon')} ${couponDefault}`}
84
- </OText>
85
- </CCButton>
86
- </OAlert>
87
- ) : (
88
- <CCWrapper>
89
- <OInput
90
- placeholder={t('DISCOUNT_COUPON', 'Discount coupon')}
91
- onChange={(e: any) => onChangeInputCoupon(e)}
92
- style={styles.inputsStyle}
93
- inputStyle={{ fontSize: 12 }}
94
- />
95
- <OButton
96
- onClick={() => handleButtonApplyClick()}
97
- bgColor={theme.colors.primary}
98
- borderColor={theme.colors.primary}
99
- textStyle={{ color: 'white', fontSize: 12 }}
100
- imgRightSrc={null}
101
- text={t('APPLY', 'Apply')}
102
- isDisabled={!couponInput}
103
- style={{ borderRadius: 7.6, height: 44, shadowOpacity: 0 }}
104
- />
105
- </CCWrapper>
106
- )}
107
- </CContainer>
108
- )
109
- }
110
-
111
- export const CouponControl = (props: any) => {
112
- const couponProp = {
113
- ...props,
114
- UIComponent: CouponControlUI
115
- }
116
- return (
117
- <CouponController {...couponProp} />
118
- )
119
- }
@@ -1,22 +0,0 @@
1
- import styled from 'styled-components/native';
2
-
3
- export const CContainer = styled.View`
4
- display: flex;
5
- justify-content: flex-start;
6
- width: 100%;
7
- padding: 5px 0px;
8
- `
9
-
10
- export const CCWrapper = styled.View`
11
- display: flex;
12
- flex-direction: row;
13
- align-items: center;
14
- justify-content: center;
15
- `
16
-
17
- export const CCButton = styled.View`
18
- width: 100%;
19
- background-color: ${(props: any) => props.theme.colors.backgroundGray};
20
- padding: 10px;
21
- border-radius: 50px;
22
- `
@@ -1,167 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { TouchableOpacity, StyleSheet, ActivityIndicator } from 'react-native';
3
- import {
4
- DriverTips as DriverTipsController,
5
- useUtils,
6
- useLanguage,
7
- useConfig,
8
- useOrder
9
- } from 'ordering-components/native';
10
- import { useTheme } from 'styled-components/native';
11
- import { OButton, OInput, OText } from '../shared';
12
-
13
- import {
14
- DTContainer,
15
- DTCard,
16
- DTWrapperTips,
17
- DTForm,
18
- DTLabel,
19
- DTWrapperInput
20
- } from './styles'
21
-
22
- const DriverTipsUI = (props: any) => {
23
- const {
24
- driverTip,
25
- driverTipsOptions,
26
- optionSelected,
27
- isFixedPrice,
28
- isDriverTipUseCustom,
29
- handlerChangeOption
30
- } = props;
31
-
32
- const [{ parsePrice }] = useUtils();
33
- const [, t] = useLanguage();
34
- const [{ configs }] = useConfig();
35
- const [{ options, carts, loading }, orderState] = useOrder();
36
-
37
- const theme = useTheme();
38
-
39
- const style = StyleSheet.create({
40
- circle: {
41
- borderRadius: 30
42
- },
43
- inputStyle: {
44
- flex: 1,
45
- borderWidth: 1,
46
- borderColor: theme.colors.border,
47
- marginRight: 10,
48
- height: 44,
49
- borderRadius: 7.6
50
- },
51
- applyBtn: {
52
- borderRadius: 7.6,
53
- height: 44,
54
- shadowOpacity: 0
55
- }
56
- })
57
-
58
- const [value, setvalue] = useState(0);
59
- const [isChanging, setChange] = useState(false);
60
- const [curOpt, setCurOpt] = useState(optionSelected);
61
-
62
- const placeholderCurrency = (configs?.currency_position?.value || 'left') === 'left'
63
- ? `${configs?.format_number_currency?.value}0`
64
- : `0${configs?.format_number_currency?.value}`
65
-
66
- const handleChangeDriverTip = (val: any) => {
67
- let tip = parseFloat(val)
68
- tip = isNaN(tip) ? 0 : tip
69
- setvalue(tip)
70
- }
71
-
72
- const handleChangeOpt = (option: any) => {
73
- setCurOpt(option);
74
- setChange(true);
75
- handlerChangeOption(option)
76
- }
77
-
78
- useEffect(() => {
79
- setChange(false);
80
- }, [optionSelected])
81
-
82
- return (
83
- <DTContainer>
84
- {!isDriverTipUseCustom ? (
85
- <>
86
- <DTLabel >
87
- {t('CUSTOM_DRIVER_TIP_MESSAGE', '100% of these tips go directly to your driver')}
88
- </DTLabel>
89
- <DTWrapperTips>
90
- {driverTipsOptions.sort((a: any, b: any) => parseInt(a) > parseInt(b)).map((option: any, i: number) => (
91
- <TouchableOpacity
92
- key={i}
93
- onPress={() => handleChangeOpt(option)}
94
- >
95
- <DTCard
96
- style={style.circle}
97
- isActive={option === optionSelected}
98
- >
99
- <OText size={13} color={option === optionSelected ? '#FFF' : theme.colors.textSecondary}>
100
- {`${isFixedPrice ? parsePrice(option) : `${option}%`}`}
101
- </OText>
102
- {loading && curOpt === option && isChanging && <ActivityIndicator color={theme.colors.primary} style={{position: 'absolute'}} />}
103
- </DTCard>
104
- </TouchableOpacity>
105
- ))}
106
- </DTWrapperTips>
107
- {!driverTipsOptions.includes(driverTip) && driverTip > 0 && (
108
- <OText
109
- color={theme.colors.error}
110
- size={20}
111
- style={{ marginTop: 10, textAlign: 'center' }}
112
- >
113
- {t('CUSTOM_DRIVER_TIP_AMOUNT', 'The driver\'s current tip comes from a custom option')}
114
- </OText>
115
- )}
116
- </>
117
- ) : (
118
- <DTForm>
119
- <DTLabel>
120
- {t('CUSTOM_DRIVER_TIP_MESSAGE', '100% of these tips go directly to your driver')}
121
- </DTLabel>
122
- <DTWrapperInput>
123
- <OInput
124
- placeholder={placeholderCurrency}
125
- style={style.inputStyle}
126
- onChange={handleChangeDriverTip}
127
- autoCapitalize='none'
128
- autoCorrect={false}
129
- />
130
- <OButton
131
- text={t('APPLY_TIP', 'Apply Tip')}
132
- bgColor={theme.colors.primary}
133
- borderColor={theme.colors.primary}
134
- textStyle={{ color: 'white', fontSize: 14 }}
135
- imgRightSrc={null}
136
- isDisabled={!(value > 0 && value !== driverTip) || !value}
137
- onClick={() => {
138
- handlerChangeOption(value)
139
- setvalue(0)
140
- }}
141
- style={style.applyBtn}
142
- />
143
- </DTWrapperInput>
144
- {parseFloat(driverTip || 0) > 0 && (
145
- <OText
146
- color={theme.colors.error}
147
- size={20}
148
- style={{ marginTop: 10, textAlign: 'center' }}
149
- >
150
- {t('CURRENT_DRIVER_TIP_AMOUNT', 'Current driver tip amount')}: {parsePrice(driverTip)}
151
- </OText>
152
- )}
153
- </DTForm>
154
- )}
155
- </DTContainer>
156
- )
157
- }
158
-
159
-
160
- export const DriverTips = (props: any) => {
161
- const driverTipsProps = {
162
- ...props,
163
- UIComponent: DriverTipsUI
164
- }
165
-
166
- return <DriverTipsController {...driverTipsProps} />
167
- }
@@ -1,63 +0,0 @@
1
- import styled, { css } from 'styled-components/native'
2
-
3
- export const DTContainer = styled.View`
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- justify-content: space-around;
8
- flex-wrap: wrap;
9
- width: 100%;
10
- `
11
-
12
- export const DTWrapperTips = styled.View`
13
- display: flex;
14
- flex-direction: row;
15
- width: 100%;
16
- justify-content: space-between;
17
- align-items: center;
18
- flex-wrap: wrap;
19
- `
20
-
21
- export const DTCard = styled.View`
22
- justify-content: center;
23
- align-items: center;
24
- padding: 10px;
25
- border: 1px solid ${(props: any) => props.isActive ? props.theme.colors.primary : props.theme.colors.border};
26
- text-transform: capitalize;
27
- min-height: 48px;
28
- min-width: 48px;
29
- width: 48px;
30
- height: 48px;
31
-
32
- ${(props: any) => props.isActive && css`
33
- background-color: ${(props: any) => props.theme.colors.primary};
34
- `}
35
- `
36
-
37
- export const DTForm = styled.View`
38
- width: 100%;
39
- display: flex;
40
- flex-direction: column;
41
- align-items: center;
42
- justify-content: center;
43
- `
44
-
45
- export const DTLabel = styled.Text`
46
- font-size: 10px;
47
- align-self: flex-start;
48
- color: ${(props: any) => props.theme.colors.textSecondary}
49
- ${(props: any) => props.theme?.rtl && css`
50
- margin-left: 20px;
51
- margin-right: 0;
52
- `}
53
- margin-top: 5px;
54
- margin-bottom: 17px;
55
- `
56
-
57
- export const DTWrapperInput = styled.View`
58
- display: flex;
59
- flex-direction: row;
60
- align-items: center;
61
- justify-content: center;
62
- margin-top: 20px;
63
- `
@@ -1,107 +0,0 @@
1
- import React from 'react';
2
- import { StyleSheet, Text } from 'react-native';
3
- import { AccessToken, LoginManager } from 'react-native-fbsdk';
4
- import { useLanguage, useSession, useApi } from 'ordering-components/native';
5
- import { useTheme } from 'styled-components/native';
6
- import Icon from 'react-native-vector-icons/FontAwesome5';
7
-
8
- import { Container, FacebookButton } from './styles';
9
-
10
- export const FacebookLogin = (props: any) => {
11
- const {
12
- handleErrors,
13
- handleLoading,
14
- handleSuccessFacebookLogin
15
- } = props
16
-
17
- const [, t] = useLanguage()
18
- const [ordering] = useApi()
19
- const [{ auth }] = useSession()
20
-
21
- const theme = useTheme();
22
-
23
- const buttonText = auth
24
- ? t('LOGOUT_WITH_FACEBOOK', 'Logout with Facebook')
25
- : t('CONTINUE_WITH_FACEBOOK', 'Continue with Facebook');
26
-
27
- const logoutWithFacebook = () => {
28
- LoginManager && LoginManager.logOut();
29
- };
30
-
31
- const handleLoginClick = async (accessToken: string) => {
32
- try {
33
- const response = await ordering.users().authFacebook({ access_token: accessToken })
34
- if (!response.content.error) {
35
- if (handleSuccessFacebookLogin) {
36
- handleSuccessFacebookLogin(response.content.result)
37
- handleLoading && handleLoading(false)
38
- }
39
- } else {
40
- handleLoading && handleLoading(false)
41
- logoutWithFacebook()
42
- }
43
- } catch (err) {
44
- handleLoading && handleLoading(false)
45
- handleErrors && handleErrors(err.message)
46
- }
47
- }
48
-
49
- const loginWithFacebook = () => {
50
- handleLoading && handleLoading(true)
51
- LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
52
- (login: any) => {
53
- if (login.isCancelled) {
54
- const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
55
- handleLoading && handleLoading(false)
56
- handleErrors && handleErrors(err)
57
- } else {
58
- AccessToken.getCurrentAccessToken().then((data: any) => {
59
- const accessToken = data.accessToken.toString();
60
- handleLoginClick(accessToken)
61
- });
62
- }
63
- },
64
- (error: any) => {
65
- const err = error
66
- ? t(error?.replace(/ /g, '_').toUpperCase(), 'Login cancelled')
67
- : t('LOGIN_FAIL_WITH_FACEBOOK', 'Login fail with facebook')
68
- handleLoading && handleLoading(false)
69
- handleErrors && handleErrors(err)
70
- },
71
- );
72
- };
73
-
74
- const onPressButton = auth
75
- ? logoutWithFacebook
76
- : loginWithFacebook;
77
-
78
- return (
79
- <Container>
80
- <FacebookButton
81
- onPress={onPressButton}
82
- >
83
- <Icon
84
- name="facebook"
85
- size={16}
86
- color={theme.colors.skyBlue}
87
- style={style.fbBtn}
88
- />
89
- <Text style={style.textBtn}>
90
- {buttonText}
91
- </Text>
92
- </FacebookButton>
93
- </Container>
94
- );
95
- }
96
-
97
- const style = StyleSheet.create({
98
- fbBtn: {
99
- position: 'absolute',
100
- left: 0,
101
- marginHorizontal: 16
102
- },
103
- textBtn: {
104
- fontSize: 14,
105
- color: '#000000'
106
- }
107
- })
@@ -1,21 +0,0 @@
1
- import styled from 'styled-components/native'
2
-
3
- export const Container = styled.View``
4
-
5
- export const FacebookButton = styled.TouchableOpacity`
6
- background-color: #FFFFFF;
7
- border-radius: 7.6px;
8
- padding: 15px 30px;
9
- font-size: 14px;
10
- font-weight: 400;
11
- text-align: center;
12
- width: 100%;
13
- display: flex;
14
- flex-direction: row;
15
- align-items: center;
16
- justify-content: center;
17
- position: relative;
18
- height: 52px;
19
- border-color: black;
20
- border-width: 1px;
21
- `
@@ -1,100 +0,0 @@
1
- import React from 'react';
2
- import {
3
- FloatingButton as FloatingButtonController,
4
- useLanguage,
5
- } from 'ordering-components/native';
6
- import { useTheme } from 'styled-components/native';
7
- import { FloatingButtonParams } from '../../types';
8
- import { Container, Button } from './styles';
9
- import { OText } from '../shared';
10
- import { StyleSheet, Platform } from 'react-native';
11
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
12
- import { View } from 'react-native';
13
-
14
- const FloatingButtonUI = (props: FloatingButtonParams) => {
15
- const {
16
- btnLeftValue,
17
- btnRightValue,
18
- btnLeftValueShow,
19
- btnRightValueShow,
20
- btnText,
21
- handleButtonClick,
22
- disabled,
23
- isSecondaryBtn,
24
- hasBottom,
25
- handleEmpty,
26
- } = props;
27
-
28
- const [, t] = useLanguage();
29
- const { bottom } = useSafeAreaInsets();
30
-
31
- const theme = useTheme();
32
-
33
- const styles = StyleSheet.create({
34
- primaryBtn: {
35
- backgroundColor: theme.colors.primary,
36
- },
37
- secondaryBtn: {
38
- backgroundColor: theme.colors.backgroundGray200,
39
- },
40
- emptyBtn: {
41
- height: 44,
42
- borderRadius: 7.6,
43
- backgroundColor: theme.colors.backgroundGray100,
44
- paddingHorizontal: 27,
45
- },
46
- infoCont: {
47
- flexDirection: 'row',
48
- alignItems: 'center',
49
- justifyContent: 'flex-start',
50
- },
51
- badge: {
52
- alignItems: 'center',
53
- justifyContent: 'center',
54
- borderRadius: 7.6,
55
- minWidth: 30,
56
- minHeight: 30,
57
- backgroundColor: theme.colors.primaryContrast,
58
- paddingHorizontal: 7
59
- }
60
- });
61
-
62
- return (
63
- <Container
64
- isIos={Platform.OS === 'ios'}
65
- style={{ paddingBottom: hasBottom ? bottom + 12 : 12 }}>
66
-
67
- <View style={styles.infoCont}>
68
- <OText color={theme.colors.textNormal} size={16} lineHeight={24} weight={'600'} mRight={20}>
69
- {btnRightValueShow ? btnRightValue : ''}
70
- </OText>
71
- {btnLeftValueShow && (
72
- <View style={styles.badge}>
73
- <OText color={theme.colors.textNormal} size={14} lineHeight={24}>
74
- {btnLeftValueShow ? btnLeftValue : ''}
75
- </OText>
76
- </View>
77
- )}
78
- </View>
79
- <Button
80
- style={[isSecondaryBtn ? styles.secondaryBtn : styles.primaryBtn]}
81
- onPress={handleButtonClick}
82
- disabled={disabled}
83
- >
84
- <OText color={isSecondaryBtn ? theme.colors.textSecondary : theme.colors.white} lineHeight={24} size={14} weight={'400'}>
85
- {btnText}
86
- </OText>
87
- </Button>
88
-
89
- </Container>
90
- );
91
- };
92
-
93
- export const FloatingButton = (props: FloatingButtonParams) => {
94
- const floatingButtonProps = {
95
- ...props,
96
- UIComponent: FloatingButtonUI,
97
- };
98
-
99
- return <FloatingButtonController {...floatingButtonProps} />;
100
- };