ordering-ui-react-native 0.22.33 → 0.22.34

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.22.33",
3
+ "version": "0.22.34",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -17,7 +17,8 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
17
17
  methodPaySupported,
18
18
  setPlaceByMethodPay,
19
19
  cartTotal,
20
- androidAppId
20
+ androidAppId,
21
+ businessNames
21
22
  } = props
22
23
  const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
23
24
  const { presentApplePay, isApplePaySupported } = useApplePay();
@@ -152,7 +153,8 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
152
153
 
153
154
  const { error, paymentMethod } = await presentApplePay({
154
155
  cartItems: [{
155
- label: t('CART_APPLE_PAY_LABEL', 'Cart'),
156
+ label: businessNames ? `${businessNames.join(', ')} ${t('VIA_CHEW_APP', 'via Chew App')}`
157
+ : `${cart?.business?.name} ${t('VIA_CHEW_APP', 'via Chew App')}`,
156
158
  amount: cartTotal?.toString?.() ?? cart?.balance?.toString() ?? cart?.total?.toString?.(),
157
159
  paymentType: 'Immediate'
158
160
  }],
@@ -495,5 +495,6 @@ export interface StripeMethodFormParams {
495
495
  methodPaySupported?: any,
496
496
  setPlaceByMethodPay?: any,
497
497
  cartTotal?: number,
498
- androidAppId?: string
498
+ androidAppId?: string,
499
+ businessNames?: Array<string>
499
500
  }
@@ -22,6 +22,7 @@ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityI
22
22
  import {
23
23
  useLanguage,
24
24
  useUtils,
25
+ useConfig
25
26
  } from 'ordering-components/native';
26
27
 
27
28
  interface OrderHeader {
@@ -49,8 +50,10 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
49
50
  } = props
50
51
  const theme = useTheme();
51
52
  const [, t] = useLanguage();
53
+ const [configState] = useConfig()
52
54
  const [{ parseDate, parsePrice }] = useUtils();
53
55
  const paymethodsLength = order?.payment_events?.filter((item: any) => item.event === 'payment')?.length
56
+ const showExternalId = configState?.configs?.change_order_id?.value === '1'
54
57
 
55
58
  const styles = StyleSheet.create({
56
59
  icons: {
@@ -270,7 +273,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
270
273
 
271
274
  <OText numberOfLines={2} size={20} weight="600">
272
275
  <>
273
- {`${t('INVOICE_ORDER_NO', 'Order No.')} ${order?.id} `}
276
+ {`${t('INVOICE_ORDER_NO', 'Order No.')} ${showExternalId ? order?.external_id || order?.id : order?.id} `}
274
277
  {!order?.isLogistic && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
275
278
  <>
276
279
  {t('IS', 'is')}{' '}
@@ -284,7 +287,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
284
287
  )}
285
288
  </>
286
289
  </OText>
287
- {order?.external_id && (
290
+ {order?.external_id && !showExternalId && (
288
291
  <OText size={13}>
289
292
  <OText size={13} weight='bold'>{`${t('EXTERNAL_ID', 'External ID :')} `}</OText>
290
293
  {order?.external_id}
@@ -191,23 +191,24 @@ export const OrderItem = React.memo((props: any) => {
191
191
  {order?.external_id ?? t('NO_EXTERNAL_ID', 'No external Id ') + t('NO', 'Order No.') + order?.id}
192
192
  </OText>
193
193
  )}
194
- <OText
194
+ {!showExternalId && <OText
195
195
  style={styles.date}
196
196
  color={theme.colors.unselectText}
197
197
  numberOfLines={1}
198
198
  adjustsFontSizeToFit
199
199
  >
200
- {(!showExternalId && ((!!order?.order_group_id && order?.order_group && isLogisticOrder
200
+ {((!!order?.order_group_id && order?.order_group && isLogisticOrder
201
201
  ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
202
202
  : (t('NO', 'Order No.') + order?.id)
203
- ) + ' · '))}
203
+ ) + ' · ')}
204
204
  {order?.delivery_datetime_utc
205
205
  ? parseDate(order?.delivery_datetime_utc)
206
206
  : parseDate(order?.delivery_datetime, { utc: false })}
207
207
  </OText>
208
+ }
208
209
  {((currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && allowColumns?.timer) && (
209
210
  <>
210
- <OText> · </OText>
211
+ {!showExternalId && <OText> · </OText>}
211
212
  <OText
212
213
  style={styles.date}
213
214
  color={
@@ -233,6 +233,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
233
233
  toSave
234
234
  businessId={businessIds[0]}
235
235
  businessIds={businessIds}
236
+ businessNames={openCarts?.map?.((cart : any) => cart?.business?.name)}
236
237
  publicKey={paymethodSelected?.data?.publishable}
237
238
  requirements={props.clientSecret}
238
239
  handleSource={handlePaymethodDataChange}
@@ -36,7 +36,8 @@ const StripeElementsFormUI = (props: any) => {
36
36
  cartTotal,
37
37
  publicKeyAddCard,
38
38
  urlScheme,
39
- androidAppId
39
+ androidAppId,
40
+ businessNames
40
41
  } = props;
41
42
 
42
43
  const theme = useTheme();
@@ -228,6 +229,7 @@ const StripeElementsFormUI = (props: any) => {
228
229
  methodPaySupported={methodPaySupported}
229
230
  setPlaceByMethodPay={setPlaceByMethodPay}
230
231
  androidAppId={androidAppId}
232
+ businessNames={businessNames}
231
233
  />
232
234
  ) : (
233
235
  <CardField