ordering-ui-react-native 0.17.67 → 0.17.68
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 +1 -1
- package/src/components/shared/OToast.tsx +2 -2
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -4
- package/themes/business/src/components/OrdersOption/index.tsx +14 -58
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +332 -242
- package/themes/business/src/components/PreviousOrders/styles.tsx +30 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +12 -2
- package/themes/business/src/components/shared/OLink.tsx +24 -12
- package/themes/business/src/components/shared/OText.tsx +3 -2
- package/themes/business/src/types/index.tsx +6 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -6
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
|
@@ -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={() =>
|
|
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
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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?: (
|
|
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 {
|
|
@@ -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}>
|