ordering-ui-react-native 0.17.67 → 0.17.69

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.
@@ -39,7 +39,8 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
39
39
  reviewState,
40
40
  setReviewState,
41
41
  actionState,
42
- handleSendCustomerReview
42
+ handleSendCustomerReview,
43
+ handleCustomCustomerReview
43
44
  } = props
44
45
 
45
46
  const theme = useTheme()
@@ -153,6 +154,15 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
153
154
 
154
155
  const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''}`?.replace(' ', ' ')?.trim() ?? ''
155
156
 
157
+ const handleReviewClick = () => {
158
+ handleCustomCustomerReview
159
+ ? handleCustomCustomerReview({
160
+ qualification: reviewState?.qualification,
161
+ comment: reviewState?.comment
162
+ })
163
+ : handleSendCustomerReview()
164
+ }
165
+
156
166
  return (
157
167
  <KeyboardAvoidingView
158
168
  enabled
@@ -303,7 +313,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
303
313
 
304
314
  <ActionButtonWrapper>
305
315
  <FloatingButton
306
- firstButtonClick={() => handleSendCustomerReview()}
316
+ firstButtonClick={() => handleReviewClick()}
307
317
  btnText={actionState.loading ? t('LOADING', 'Loading') : t('SEND_REVIEW', 'Send Review')}
308
318
  color={theme.colors.primary}
309
319
  widthButton={'100%'}
@@ -29,8 +29,19 @@ const OLink = (props: Props): React.ReactElement => {
29
29
  ],
30
30
  );
31
31
 
32
+ const handleInvalidNumberAlert = () =>
33
+ Alert.alert(
34
+ t('ERROR_OPENING_THE_LINK', 'Error opening the link'),
35
+ t('INVALID_NUMBER', 'Invalid number'),
36
+ [
37
+ {
38
+ text: t('OK', 'Ok'),
39
+ },
40
+ ],
41
+ );
42
+
32
43
  const handleOpenUrl = async (breakFunction = false) => {
33
- if(breakFunction) {
44
+ if (breakFunction) {
34
45
  return
35
46
  }
36
47
  if (!url) {
@@ -40,8 +51,9 @@ const OLink = (props: Props): React.ReactElement => {
40
51
 
41
52
  try {
42
53
  const supported = await Linking.canOpenURL(url);
43
-
44
- if (supported) {
54
+ if (url && url?.includes('tel:')) {
55
+ url?.includes('invalid') ? handleInvalidNumberAlert() : await Linking.openURL(url)
56
+ } else if (supported) {
45
57
  await Linking.openURL(url);
46
58
  } else {
47
59
  handleAlert();
@@ -57,17 +69,17 @@ const OLink = (props: Props): React.ReactElement => {
57
69
  <OButton
58
70
  onClick={() => handleOpenUrl()}
59
71
  text={shorcut} imgRightSrc=''
60
- textStyle={{color: 'white'}}
61
- style={{width: '100%', alignSelf: 'center', borderRadius: 10}}
72
+ textStyle={{ color: 'white' }}
73
+ style={{ width: '100%', alignSelf: 'center', borderRadius: 10 }}
62
74
  />
63
75
  ) : (
64
- <OText
65
- style={TextStyle}
66
- numberOfLines={1}
67
- ellipsizeMode="tail"
68
- color={color}>
69
- {shorcut}
70
- </OText>
76
+ <OText
77
+ style={TextStyle}
78
+ numberOfLines={1}
79
+ ellipsizeMode="tail"
80
+ color={color}>
81
+ {shorcut}
82
+ </OText>
71
83
  )}
72
84
  </Pressable>
73
85
  );
@@ -40,12 +40,13 @@ interface Props {
40
40
  numberOfLines?: number;
41
41
  ellipsizeMode?: string;
42
42
  adjustsFontSizeToFit?: boolean;
43
- textDecorationLine?: string
43
+ textDecorationLine?: string;
44
+ lineHeight?: number;
44
45
  }
45
46
 
46
47
  const OText = (props: Props): React.ReactElement => {
47
48
  return (
48
- <SText {...props} style={props.style}>
49
+ <SText {...props} style={[props.style, { lineHeight: props.lineHeight }]}>
49
50
  {props.children}
50
51
  {props.space && ' '}
51
52
  </SText>
@@ -311,6 +311,10 @@ export interface OrdersOptionParams {
311
311
  isLogisticActivated?: boolean;
312
312
  isAlsea?: boolean;
313
313
  checkNotification?: boolean;
314
+ ordersGroupedFormatted?: any;
315
+ handleChangeOrderStatus?: () => void;
316
+ handleSendCustomerReview?: () => void;
317
+ orderDetailsProps?: any;
314
318
  }
315
319
  export interface ActiveOrdersParams {
316
320
  orders?: any;
@@ -569,7 +573,7 @@ export interface AcceptOrRejectOrderParams {
569
573
  loading?: boolean;
570
574
  action: string;
571
575
  orderId?: number;
572
- handleUpdateOrder?: (status: number, isAccept: any) => {};
576
+ handleUpdateOrder?: () => void;
573
577
  notShowCustomerPhone?: boolean | undefined;
574
578
  actions?: actions;
575
579
  titleAccept?: textTranslate;
@@ -598,6 +602,7 @@ export interface ReviewCustomerParams {
598
602
  actionState?: any,
599
603
  handleChangeQualification?: any,
600
604
  handleSendCustomerReview?: any,
605
+ handleCustomCustomerReview?: any,
601
606
  }
602
607
 
603
608
  export interface NoNetworkParams {
@@ -97,6 +97,7 @@ import { UserFormDetailsUI } from './src/components/UserFormDetails';
97
97
  import { WalletTransactionItem } from './src/components/WalletTransactionItem';
98
98
  import { Promotions } from './src/components/Promotions'
99
99
  import { PageBanner } from './src/components/PageBanner'
100
+ import { MultiCart } from './src/components/MultiCart'
100
101
  import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
101
102
 
102
103
  import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
@@ -262,6 +263,7 @@ export {
262
263
  Promotions,
263
264
  PageBanner,
264
265
  MyOrders,
266
+ MultiCart,
265
267
  ORDER_TYPES,
266
268
  USER_TYPE,
267
269
 
@@ -59,11 +59,6 @@ export const Otp = (props: otpParams) => {
59
59
  justifyContent: 'space-between',
60
60
  marginVertical: 30
61
61
  },
62
- focusStyles: {
63
- borderColor: theme.colors.primary,
64
- borderWidth: 1,
65
- borderRadius: 8
66
- },
67
62
  underlineStyleBase: {
68
63
  width: 45,
69
64
  height: 50,
@@ -91,7 +86,6 @@ export const Otp = (props: otpParams) => {
91
86
  numberOfInputs={pinCount || 6}
92
87
  style={loginStyle.container}
93
88
  inputStyles={loginStyle.underlineStyleBase}
94
- focusStyles={loginStyle.focusStyles}
95
89
  handleChange={setCode}
96
90
  />
97
91
  <TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
@@ -3,5 +3,4 @@ import styled from 'styled-components/native';
3
3
  export const OTPContainer = styled.View`
4
4
  padding: 20px;
5
5
  align-items: center;
6
- flex: 1
7
6
  `
@@ -232,7 +232,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
232
232
  <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
233
233
  <View style={{ flexDirection: 'row' }}>
234
234
  <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
235
- {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
235
+ {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || !!product.comment) && (
236
236
  <MaterialCommunityIcon name='chevron-down' size={18} />
237
237
  )}
238
238
  </View>
@@ -305,7 +305,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
305
305
  ))}
306
306
  </ProductOptionsList>
307
307
  )}
308
- {product.comment && (
308
+ {!!product.comment && (
309
309
  <ProductComment>
310
310
  <OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
311
311
  <OText size={10} color={theme.colors.textThird}>{product.comment}</OText>