ordering-ui-react-native 0.12.55 → 0.12.59

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 (202) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
  7. package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
  8. package/themes/business/src/layouts/Container.tsx +3 -1
  9. package/themes/doordash/src/components/Cart/index.tsx +37 -2
  10. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  11. package/themes/doordash/src/components/OrderSummary/index.tsx +37 -3
  12. package/themes/doordash/src/layouts/Container.tsx +1 -1
  13. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  14. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  15. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  16. package/themes/instacart/src/layouts/Container.tsx +1 -1
  17. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  18. package/themes/original/src/components/Cart/index.tsx +268 -234
  19. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  20. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  21. package/themes/original/src/layouts/Container.tsx +1 -1
  22. package/themes/single-business/src/components/Cart/index.tsx +127 -16
  23. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  24. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  25. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  26. package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
  27. package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
  28. package/themes/single-business/src/layouts/Container.tsx +1 -1
  29. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  30. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  31. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  32. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
  33. package/themes/franchises/index.tsx +0 -111
  34. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  35. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  36. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  37. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  38. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  39. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  40. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  41. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  42. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  43. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  44. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  45. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  46. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  47. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  48. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  49. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  50. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  51. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  52. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  53. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  54. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  55. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  56. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  57. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  58. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  59. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  60. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  61. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  62. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  63. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  64. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  65. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  66. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  67. package/themes/franchises/src/components/Cart/index.tsx +0 -298
  68. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  69. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  70. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  71. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  72. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  73. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  74. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  75. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  76. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  77. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  78. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  79. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  80. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  81. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  82. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  83. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  84. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  85. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  86. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  87. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  88. package/themes/franchises/src/components/Help/index.tsx +0 -56
  89. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  90. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  91. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  92. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  93. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  94. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  95. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  96. package/themes/franchises/src/components/Home/index.tsx +0 -102
  97. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  98. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  99. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  100. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  101. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  102. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  103. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  104. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  105. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  106. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  107. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  108. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  109. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  110. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  111. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  112. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  113. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  114. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  115. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  116. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
  117. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  118. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
  119. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  120. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  121. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  122. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  123. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  124. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  125. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  126. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  127. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  128. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  129. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  130. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  131. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  132. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  133. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  134. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  135. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  136. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  137. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  138. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  139. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  140. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  141. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  142. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  143. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  144. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  145. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  146. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  147. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  148. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  149. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  150. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  151. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  152. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  153. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  154. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  155. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  156. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  157. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  158. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  159. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  160. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  161. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  162. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  163. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  164. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  165. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  166. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  167. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  168. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  169. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  170. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  171. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  172. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  173. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  174. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  175. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  176. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  177. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  178. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  179. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  180. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  181. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  182. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  183. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  184. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  185. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  186. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  187. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  188. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  189. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  190. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  191. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  192. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  193. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  194. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  195. package/themes/franchises/src/components/shared/index.tsx +0 -29
  196. package/themes/franchises/src/config/constants.tsx +0 -57
  197. package/themes/franchises/src/layouts/Container.tsx +0 -23
  198. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  199. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  200. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  201. package/themes/franchises/src/types/index.tsx +0 -445
  202. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -1,172 +0,0 @@
1
- import * as React from 'react';
2
- import { Modal, StyleSheet, Text, SafeAreaView, View, TouchableOpacity } from "react-native";
3
- import { OIcon } from '.';
4
- import { useTheme } from 'styled-components/native';
5
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
-
7
- interface Props {
8
- open?: boolean;
9
- title?: string;
10
- children?: any;
11
- onAccept?: any;
12
- onCancel?: any;
13
- onClose?: any;
14
- style?: any;
15
- acceptText?: string;
16
- cancelText?: string;
17
- isTransparent?: boolean;
18
- hideCloseDefault?: boolean;
19
- entireModal?: boolean;
20
- customClose?: boolean;
21
- titleSectionStyle?: any;
22
- isNotDecoration?: boolean;
23
- styleCloseButton?: any
24
- }
25
-
26
- const OModal = (props: Props): React.ReactElement => {
27
- const {
28
- open,
29
- title,
30
- children,
31
- onAccept,
32
- onCancel,
33
- onClose,
34
- acceptText,
35
- cancelText,
36
- isTransparent,
37
- hideCloseDefault,
38
- entireModal,
39
- customClose,
40
- titleSectionStyle,
41
- isNotDecoration,
42
- style,
43
- styleCloseButton
44
- } = props
45
-
46
- const theme = useTheme();
47
- const { top } = useSafeAreaInsets();
48
-
49
- return (
50
- <Modal
51
- animationType="slide"
52
- transparent={isTransparent}
53
- visible={open}
54
- onRequestClose={() => onClose()}
55
- style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
56
- >
57
- <SafeAreaView style={styles.container}>
58
- {!entireModal ? (
59
- <View style={styles.centeredView}>
60
- <View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
61
- <TouchableOpacity style={styles.wrapperIcon} onPress={onClose}>
62
- <OIcon
63
- src={theme.images.general.close}
64
- width={16}
65
- style={isNotDecoration && (styleCloseButton || styles.cancelBtn)}
66
- />
67
- </TouchableOpacity>
68
- <Text style={styles.modalText}>{title || ''}</Text>
69
- </View>
70
- {children}
71
- </View>
72
- ) :
73
- <View>
74
- {!customClose && (
75
- <View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
76
- <TouchableOpacity style={styles.wrapperIcon} onPress={onClose}>
77
- <OIcon
78
- src={theme.images.general.close}
79
- width={16}
80
- style={styleCloseButton || styles.cancelBtn}
81
- />
82
- </TouchableOpacity>
83
- <Text style={styles.modalText}>{title || ''}</Text>
84
- </View>
85
- )}
86
- {children}
87
- </View>
88
- }
89
- </SafeAreaView>
90
- </Modal>
91
- );
92
- };
93
-
94
- const styles = StyleSheet.create({
95
- container: {
96
- flex: 1,
97
- },
98
- centeredView: {
99
- justifyContent: "center",
100
- alignItems: 'flex-start',
101
- position: 'relative',
102
- width: '100%',
103
- },
104
- titleSection: {
105
- width: '100%',
106
- flex: 1,
107
- justifyContent: 'space-between',
108
- alignItems: 'flex-start',
109
- paddingLeft: 40,
110
- paddingRight: 40,
111
- marginBottom: 40
112
- },
113
- cancelBtn: {
114
- // position: 'absolute',
115
- // left: 0,
116
- // margin: 15,
117
- // zIndex: 10000
118
- },
119
- modalText: {
120
- marginTop: 15,
121
- fontSize: 20,
122
- lineHeight: 30,
123
- fontWeight: '600',
124
- textAlign: "center",
125
- zIndex: 10
126
- },
127
- wrapperIcon: {
128
- overflow: 'hidden',
129
- backgroundColor: 'transparent',
130
- width: 35,
131
- height: 35,
132
- marginStart: -4,
133
- marginTop: 12,
134
- alignItems: 'center',
135
- justifyContent: 'center',
136
- zIndex: 99999
137
- },
138
-
139
- modalView: {
140
- margin: 20,
141
- backgroundColor: "white",
142
- borderRadius: 20,
143
- padding: 35,
144
- alignItems: "center",
145
- shadowColor: "#000",
146
- shadowOffset: {
147
- width: 0,
148
- height: 2
149
- },
150
- shadowOpacity: 0.25,
151
- shadowRadius: 4,
152
- elevation: 5
153
- },
154
- button: {
155
- borderRadius: 20,
156
- padding: 10,
157
- elevation: 2
158
- },
159
- buttonOpen: {
160
- backgroundColor: "#F194FF",
161
- },
162
- buttonClose: {
163
- backgroundColor: "#2196F3",
164
- },
165
- textStyle: {
166
- color: "white",
167
- fontWeight: "bold",
168
- textAlign: "center"
169
- },
170
- });
171
-
172
- export default OModal;
@@ -1,52 +0,0 @@
1
- import * as React from 'react';
2
- import {TextStyle} from 'react-native';
3
- import styled, {css} from 'styled-components/native';
4
-
5
- const SText = styled.Text`
6
- color: ${(props: any) => props.color || 'black'};
7
- font-family: 'Poppins-Regular';
8
- font-size: ${(props: any) => (props.size ? `${props.size}px` : '14px')};
9
- flex-wrap: wrap;
10
- margin-bottom: ${(props: any) =>
11
- props.hasBottom ? '10px' : props.mBottom ? `${props.mBottom}px` : 0};
12
- margin-right: ${(props: any) =>
13
- props.hasBottom ? '10px' : props.mRight ? `${props.mRight}px` : 0};
14
- margin-left: ${(props: any) =>
15
- props.hasBottom ? '10px' : props.mLeft ? `${props.mLeft}px` : 0};
16
- ${(props: any) =>
17
- props.weight &&
18
- css`
19
- font-weight: ${props.weight};
20
- `};
21
- ${(props: any) =>
22
- props.isWrap &&
23
- css`
24
- flex: ${props.weight ? 1 : 0};
25
- `};
26
- `;
27
- interface Props {
28
- color?: string;
29
- size?: number;
30
- weight?: any;
31
- style?: TextStyle;
32
- children?: JSX.Element | JSX.Element[] | string;
33
- isWrap?: boolean;
34
- hasBottom?: boolean;
35
- mBottom?: any;
36
- space?: any;
37
- mRight?: number;
38
- mLeft?: number;
39
- numberOfLines?: number;
40
- ellipsizeMode?: string;
41
- lineHeight?: number;
42
- }
43
-
44
- const OText = (props: Props): React.ReactElement => {
45
- return (
46
- <SText {...props} style={[props.style, {lineHeight: props.lineHeight}]}>
47
- {props.children}{props.space && ' '}
48
- </SText>
49
- );
50
- };
51
-
52
- export default OText;
@@ -1,36 +0,0 @@
1
- import * as React from 'react'
2
- import styled, { useTheme } from 'styled-components/native'
3
-
4
- const Inner = styled.TextInput`
5
- height: 150px;
6
- `
7
-
8
- interface Props {
9
- lines?: number,
10
- value?: string,
11
- placeholder?: string
12
- }
13
-
14
- const OTextarea = (props: Props) => {
15
-
16
- const theme = useTheme();
17
- const Wrapper = styled.View`
18
- padding: 10px;
19
- border-radius: 10px;
20
- border: 1px solid ${theme.colors.lightGray};
21
- `
22
- return (
23
- <Wrapper>
24
- <Inner
25
- placeholder={props.placeholder}
26
- placeholderTextColor={theme.colors.lightGray}
27
- numberOfLines={props.lines}
28
- underlineColorAndroid={'transparent'}
29
- value={props.value}
30
- multiline={true}
31
- />
32
- </Wrapper>
33
- )
34
- }
35
-
36
- export default OTextarea;
@@ -1,93 +0,0 @@
1
- import * as React from "react";
2
- import { Animated, StyleSheet, Text, View } from "react-native";
3
- import { ToastType, useToast } from 'ordering-components/native';
4
- import { useTheme } from 'styled-components/native';
5
-
6
- const fadeDuration = 300;
7
- const bottomPosition = 20;
8
-
9
- export const Toast: React.FC = () => {
10
- const theme = useTheme();
11
- // const insets = useSafeAreaInsets();
12
- const [, { toastConfig, hideToast }] = useToast();
13
- const opacity = React.useRef(new Animated.Value(0)).current;
14
-
15
- const fadeIn = React.useCallback(() => {
16
- Animated.timing(opacity, {
17
- toValue: 1,
18
- duration: fadeDuration,
19
- useNativeDriver: true,
20
- }).start();
21
- }, [opacity]);
22
-
23
- const fadeOut = React.useCallback(() => {
24
- Animated.timing(opacity, {
25
- toValue: 0,
26
- duration: fadeDuration,
27
- useNativeDriver: true,
28
- }).start(() => {
29
- hideToast();
30
- });
31
- }, [opacity, hideToast]);
32
-
33
- React.useEffect(() => {
34
- if (!toastConfig) {
35
- return;
36
- }
37
-
38
- fadeIn();
39
- const timer = setTimeout(fadeOut, toastConfig.duration);
40
-
41
- return () => clearTimeout(timer);
42
- }, [toastConfig, fadeIn, fadeOut]);
43
-
44
- if (!toastConfig) {
45
- return null;
46
- }
47
-
48
- const { type, message } = toastConfig;
49
-
50
- let backgroundColor;
51
- switch (type) {
52
- case ToastType.Info:
53
- backgroundColor = '#6ba4ff';
54
- break;
55
- case ToastType.Error:
56
- backgroundColor = theme.colors.primary;
57
- break;
58
- case ToastType.Success:
59
- backgroundColor = '#73bd24';
60
- break;
61
- }
62
-
63
- return (
64
- <Animated.View
65
- style={[
66
- styles.container,
67
- { bottom: bottomPosition, opacity },
68
- ]}
69
- >
70
- <View style={[styles.toast, { backgroundColor }]}>
71
- <Text style={styles.message}>{message}</Text>
72
- </View>
73
- </Animated.View>
74
- );
75
- };
76
-
77
- const styles = StyleSheet.create({
78
- container: {
79
- alignSelf: "center",
80
- position: "absolute",
81
- maxWidth: 480,
82
- zIndex: 9999999999
83
- },
84
- toast: {
85
- borderRadius: 16,
86
- padding: 16,
87
- },
88
- message: {
89
- fontSize: 14,
90
- textAlign: "center",
91
- color: '#fff',
92
- },
93
- });
@@ -1,158 +0,0 @@
1
- import * as React from 'react';
2
- import {
3
- StyleSheet,
4
- Text,
5
- View,
6
- TouchableOpacity,
7
- Animated,
8
- Platform,
9
- TextStyle
10
- } from "react-native";
11
-
12
- interface propTypes {
13
- isOn: boolean,
14
- label?: string,
15
- onColor?: string,
16
- offColor?: string,
17
- size?: string,
18
- labelStyle?: TextStyle,
19
- thumbOnStyle?: any,
20
- thumbOffStyle?: any,
21
- trackOnStyle?: any,
22
- trackOffStyle?: any,
23
- onToggle: any,
24
- icon?: any,
25
- disabled?: boolean,
26
- animationSpeed?: number,
27
- useNativeDriver?: boolean,
28
- circleColor?: string,
29
- };
30
-
31
- const OToggleSwitch = (props: propTypes) => {
32
-
33
- const calculateDimensions = (size: string) => {
34
- switch (size) {
35
- case "small":
36
- return {
37
- width: 40,
38
- padding: 10,
39
- circleWidth: 15,
40
- circleHeight: 15,
41
- translateX: 22
42
- };
43
- case "large":
44
- return {
45
- width: 70,
46
- padding: 20,
47
- circleWidth: 30,
48
- circleHeight: 30,
49
- translateX: 38
50
- };
51
- default:
52
- return {
53
- width: 50,
54
- padding: 15,
55
- circleWidth: 25,
56
- circleHeight: 25,
57
- translateX: 30
58
- };
59
- }
60
- }
61
-
62
- const offsetX = new Animated.Value(0);
63
- const dimensions = calculateDimensions(props.size || 'medium');
64
-
65
- const createToggleSwitchStyle = () => [
66
- {
67
- justifyContent: "center",
68
- width: dimensions.width,
69
- borderRadius: 20,
70
- padding: dimensions.padding,
71
- backgroundColor: props.isOn ? props.onColor : props.offColor
72
- },
73
- props.isOn ? props.trackOnStyle : props.trackOffStyle
74
- ];
75
-
76
- const createInsideCircleStyle = () => [
77
- {
78
- alignItems: "center",
79
- justifyContent: "center",
80
- margin: Platform.OS === "web" ? 0 : 4,
81
- left: Platform.OS === "web" ? 4 : 0,
82
- position: "absolute",
83
- backgroundColor: props.circleColor,
84
- transform: [{ translateX: offsetX }],
85
- width: dimensions.circleWidth,
86
- height: dimensions.circleHeight,
87
- borderRadius: dimensions.circleWidth / 2,
88
- shadowColor: "#000",
89
- shadowOffset: {
90
- width: 0,
91
- height: 2
92
- },
93
- shadowOpacity: 0.2,
94
- shadowRadius: 2.5,
95
- elevation: 1.5
96
- },
97
- props.isOn ? props.thumbOnStyle : props.thumbOffStyle
98
- ];
99
-
100
-
101
- const { isOn, onToggle, disabled, labelStyle, label, icon } = props;
102
-
103
- const toValue = isOn
104
- ? dimensions.width - dimensions.translateX
105
- : 0;
106
-
107
- Animated.timing(offsetX, {
108
- toValue,
109
- duration: props.animationSpeed,
110
- useNativeDriver: props.useNativeDriver || false,
111
- }).start();
112
-
113
- return (
114
- <View style={styles.container}>
115
- {label ? (
116
- <Text style={[styles.labelStyle, labelStyle]}>{label}</Text>
117
- ) : null}
118
- <TouchableOpacity
119
- style={createToggleSwitchStyle()}
120
- activeOpacity={0.8}
121
- onPress={() => (disabled ? null : onToggle(!isOn))}
122
- >
123
- <Animated.View style={createInsideCircleStyle()}>
124
- {icon}
125
- </Animated.View>
126
- </TouchableOpacity>
127
- </View>
128
- );
129
- }
130
-
131
- const styles = StyleSheet.create({
132
- container: {
133
- flexDirection: "row",
134
- alignItems: "center"
135
- },
136
- labelStyle: {
137
- marginHorizontal: 10
138
- }
139
- });
140
-
141
- OToggleSwitch.defaultProps = {
142
- isOn: false,
143
- onColor: "#4cd137",
144
- offColor: "#ecf0f1",
145
- size: "medium",
146
- labelStyle: {},
147
- thumbOnStyle: {},
148
- thumbOffStyle: {},
149
- trackOnStyle: {},
150
- trackOffStyle: {},
151
- icon: null,
152
- disabled: false,
153
- animationSpeed: 300,
154
- useNativeDriver: true,
155
- circleColor: 'white'
156
- };
157
-
158
- export default OToggleSwitch;
@@ -1,29 +0,0 @@
1
- import OText from './OText'
2
- import OButton from './OButton'
3
- import OInput from './OInput'
4
- import ODropDown from './ODropDown'
5
- import OIcon from './OIcon'
6
- import OIconText from './OIconText'
7
- import OIconButton from './OIconButton'
8
- import OTextarea from './OTextarea'
9
- import OToggle from './OToggle'
10
- import OKeyButton from './OKeyButton'
11
- import OModal from './OModal'
12
- import OAlert from './OAlert'
13
- import OBottomPopup from './OBottomPopup'
14
-
15
- export {
16
- OText,
17
- OButton,
18
- OInput,
19
- ODropDown,
20
- OIcon,
21
- OIconText,
22
- OIconButton,
23
- OTextarea,
24
- OToggle,
25
- OKeyButton,
26
- OAlert,
27
- OModal,
28
- OBottomPopup,
29
- }
@@ -1,57 +0,0 @@
1
- export const USER_TYPE = {
2
- BUSINESS: 'business',
3
- CUSTOMER: 'customer',
4
- DRIVER: 'driver'
5
- }
6
-
7
- export const ORDER_TYPES = [
8
- {
9
- value: 1,
10
- content: 'DELIVERY',
11
- description: 'DELIVERY_DESCRIPTION'
12
- },
13
- {
14
- value: 2,
15
- content: 'PICKUP',
16
- description: 'PICKUP_DESCRIPTION',
17
- },
18
- {
19
- value: 3,
20
- content: 'EAT_IN',
21
- description: 'EAT_IN_DESCRIPTION',
22
- },
23
- {
24
- value: 4,
25
- content: 'CURBSIDE',
26
- description: 'CURBSIDE_DESCRIPTION',
27
- },
28
- {
29
- value: 5,
30
- content: 'DRIVE_THRU',
31
- description: 'DRIVE_THRU_DESCRIPTION',
32
- }
33
- ]
34
-
35
- export const REVIEW_ORDER_COMMENTS = [
36
- { key: 'IT_WASNT_TASTY', value: 'It wasn\'t tasty' },
37
- { key: 'IT_DOESNT_PACK_WELL', value: 'It doesn\'t pack well' },
38
- { key: 'IT_ISNT_WORTH_WHAT_IT_COASTS', value: 'It isn\'t worth what it coasts' },
39
- { key: 'TO_SLOW', value: 'To slow' },
40
- { key: 'SUSTAINABLE_PACKAGING_WASNT_USED', value: 'Sustainable packaging wasn\'t used' },
41
- { key: 'THEY_DID_NOT_FOLLOW_THE_ORDER_NOTES', value: 'They didn\'t follow the order notes' }
42
- ]
43
-
44
- export const REVIEW_PRODUCT_COMMENTS = [
45
- { key: 'IT_WASNT_TASTY', value: 'It wasn\'t tasty'},
46
- { key: 'SMALL_PORTION', value: 'Small portion'},
47
- { key: 'WET_OR_LEAKY', value: 'Wet or leaky'},
48
- { key: 'SLOPPY_PRESENTATION', value: 'Sloppy presentation'},
49
- { key: 'COLD_OR_MELTED', value: 'Cold or melted'}
50
- ]
51
-
52
- export const REVIEW_DRIVER_COMMENTS = [
53
- { key: 'FAST_AND_EFFICIENT', value: 'Fast and efficient'},
54
- { key: 'DELIVERY_PERFECT', value: 'Delivery perfect'},
55
- { key: 'EXCELLENT_COMMUNICATION', value: 'Excellent communication'},
56
- { key: 'CORDIAL_SERVICE', value: 'Cordial service'},
57
- ]
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import styled, { css } from 'styled-components/native';
3
-
4
- const ContainerStyled = styled.ScrollView`
5
- flex: 1;
6
- padding: ${(props: any) => props.noPadding ? '0' : '0 40px'};
7
- background-color: ${(props: any) => props.theme.colors.backgroundPage};
8
- `;
9
-
10
- const SafeAreaStyled = styled.SafeAreaView`
11
- flex: 1;
12
- background-color: ${(props: any) => props.theme.colors.backgroundPage};
13
- `;
14
-
15
- export const Container = (props: any) => {
16
- return (
17
- <SafeAreaStyled>
18
- <ContainerStyled keyboardShouldPersistTaps='handled' {...props} style={{...props.style}}>
19
- {props.children}
20
- </ContainerStyled>
21
- </SafeAreaStyled>
22
- )
23
- }
@@ -1,6 +0,0 @@
1
- import styled from 'styled-components/native';
2
-
3
- export const SafeAreaContainer = styled.SafeAreaView`
4
- flex: 1;
5
- background-color: ${(props: any) => props.theme.colors.backgroundPage};
6
- `
@@ -1,43 +0,0 @@
1
- import * as React from 'react'
2
- import AwesomeAlert from 'react-native-awesome-alerts'
3
- import { getTraduction } from '../utils'
4
- import { useLanguage } from 'ordering-components/native'
5
- import { useTheme } from 'styled-components/native'
6
- interface Props {
7
- open: boolean,
8
- title: string,
9
- content: Array<string>,
10
- onClose: () => void,
11
- onAccept: () => void
12
- }
13
-
14
- const Alert = (props: Props) => {
15
- const {
16
- open,
17
- title,
18
- content,
19
- onClose,
20
- onAccept,
21
- } = props
22
-
23
- const theme = useTheme();
24
- const [, t] = useLanguage();
25
-
26
- return (
27
- <AwesomeAlert
28
- show={open}
29
- showProgress={false}
30
- title={title}
31
- message={getTraduction(content?.[0])}
32
- closeOnTouchOutside={true}
33
- closeOnHardwareBackPress={false}
34
- showConfirmButton={true}
35
- confirmText={t('ACCEPT', 'Accept')}
36
- confirmButtonColor={theme.colors.primary}
37
- onCancelPressed={() => onClose()}
38
- onConfirmPressed={() => onAccept()}
39
- />
40
- )
41
- }
42
-
43
- export default Alert;