ordering-ui-react-native 0.19.8-release → 0.19.9-release

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.19.8-release",
3
+ "version": "0.19.9-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -118,7 +118,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
118
118
  : parseDate(order?.delivery_datetime, { utc: false })
119
119
  }
120
120
  </br>
121
- ${paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD'}: ${handlePaymethodsListString()}
121
+ ${t(paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD', paymethodsLength > 1 ? 'Payment methods' : 'Payment method')}: ${handlePaymethodsListString()}
122
122
  </p>
123
123
 
124
124
  <h1>${t('CUSTOMER_DETAILS', 'Customer details')}</h1>
@@ -72,7 +72,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
72
72
 
73
73
  const getProductPrice = (product: any) => {
74
74
  let subOptionPrice = 0;
75
- if (product?.options?.length > 0 && product?.options?.suboptions?.length > 0) {
75
+ if (product?.options?.length > 0 && product?.options[0]?.suboptions?.length > 0) {
76
76
  for (const option of product?.options) {
77
77
  for (const suboption of option?.suboptions) {
78
78
  subOptionPrice += suboption.quantity * suboption.price;
@@ -118,7 +118,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
118
118
 
119
119
  const onTextLayout = useCallback((e: any) => {
120
120
  setLengthMore((e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2); //to check the text is more than 2 lines or not
121
- },[]);
121
+ }, []);
122
122
 
123
123
  return (
124
124
  <AccordionSection>
@@ -47,7 +47,8 @@ const ProfileUI = (props: ProfileParams) => {
47
47
  cleanFormState,
48
48
  handleToggleAvalaibleStatusDriver,
49
49
  isAlsea,
50
- isHideDriverStatus
50
+ isShowDriverStatus,
51
+ navigation
51
52
  } = props;
52
53
 
53
54
  const [{ user, sessionLoading }] = useSession();
@@ -361,7 +362,7 @@ const ProfileUI = (props: ProfileParams) => {
361
362
  />
362
363
  </CenterView>
363
364
 
364
- {user?.level === 4 && !isHideDriverStatus && (
365
+ {user?.level === 4 && (
365
366
  <EnabledStatusDriver>
366
367
  <View style={{ flex: 1 }}>
367
368
  <OText
@@ -369,29 +370,33 @@ const ProfileUI = (props: ProfileParams) => {
369
370
  adjustsFontSizeToFit
370
371
  style={{ ...styles.label, paddingHorizontal: 0 }}>
371
372
  {t(
372
- 'AVAILABLE_TO_RECEIVE_ORDERS',
373
- 'Available to receive orders',
373
+ `${!isShowDriverStatus ? 'NOT_' : ''}AVAILABLE_TO_RECEIVE_ORDERS`,
374
+ `${!isShowDriverStatus ? 'You are not ' : ''}Available to receive orders`
374
375
  )}
375
376
  </OText>
376
377
  </View>
377
378
 
378
- {userState.loadingDriver ? (
379
- <ActivityIndicator size="small" color={theme.colors.primary} />
380
- ) : (
381
- <ToggleSwitch
382
- isOn={userState?.result?.result?.available}
383
- onColor={theme.colors.primary}
384
- offColor={theme.colors.offColor}
385
- size="small"
386
- onToggle={() =>
387
- handleToggleAvalaibleStatusDriver &&
388
- handleToggleAvalaibleStatusDriver(
389
- !userState?.result?.result?.available,
390
- )
391
- }
392
- disabled={userState?.loading}
393
- animationSpeed={200}
394
- />
379
+ {isShowDriverStatus && (
380
+ <>
381
+ {userState.loadingDriver ? (
382
+ <ActivityIndicator size="small" color={theme.colors.primary} />
383
+ ) : (
384
+ <ToggleSwitch
385
+ isOn={userState?.result?.result?.available}
386
+ onColor={theme.colors.primary}
387
+ offColor={theme.colors.offColor}
388
+ size="small"
389
+ onToggle={() =>
390
+ handleToggleAvalaibleStatusDriver &&
391
+ handleToggleAvalaibleStatusDriver(
392
+ !userState?.result?.result?.available,
393
+ )
394
+ }
395
+ disabled={userState?.loading}
396
+ animationSpeed={200}
397
+ />
398
+ )}
399
+ </>
395
400
  )}
396
401
  </EnabledStatusDriver>
397
402
  )}
@@ -57,7 +57,7 @@ export interface ProfileParams {
57
57
  showField?: any;
58
58
  isRequiredField?: any;
59
59
  isAlsea?: boolean;
60
- isHideDriverStatus?: boolean;
60
+ isShowDriverStatus?: boolean;
61
61
  isFocused?: boolean;
62
62
  }
63
63