ordering-ui-react-native 0.23.74 → 0.23.75

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.23.74",
3
+ "version": "0.23.75",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -73,6 +73,7 @@ const CartUI = (props: any) => {
73
73
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null, type: '' })
74
74
  const [openPlaceModal, setOpenPlaceModal] = useState(false)
75
75
  const [maxDate, setMaxDate] = useState<any>(null)
76
+ const [comment] = useState<any>(cart?.comment ?? '')
76
77
  const isCartPending = cart?.status === 2
77
78
  const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
78
79
  const business: any = (orderState?.carts && Object.values(orderState.carts).find((_cart: any) => _cart?.uuid === props.cartuuid)) ?? {}
@@ -523,7 +524,7 @@ const CartUI = (props: any) => {
523
524
  <OText size={16} lineHeight={18}>{t('COMMENTS', 'Comments')}</OText>
524
525
  <View style={{ flex: 1, width: '100%' }}>
525
526
  <OInput
526
- value={cart?.comment}
527
+ value={comment || cart?.comment}
527
528
  placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
528
529
  onChange={(value: string) => handleChangeComment(value)}
529
530
  style={{
@@ -649,6 +650,7 @@ const CartUI = (props: any) => {
649
650
  export const Cart = (props: any) => {
650
651
  const cartProps = {
651
652
  ...props,
653
+ disablePreviousComment: true,
652
654
  UIComponent: CartUI
653
655
  }
654
656
 
@@ -59,6 +59,7 @@ const OrderSummaryUI = (props: any) => {
59
59
  const [{ parsePrice, parseNumber }] = useUtils();
60
60
  const commentRef = useRef()
61
61
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null, type: '' })
62
+ const [comment] = useState<any>(orderState?.carts?.[`businessId:${props.cart.business_id}`].comment ?? '')
62
63
  const hideCartDiscount = hideCouponByValidationCheckout
63
64
  const hideCartComments = hideCommentsByValidationCheckout
64
65
 
@@ -349,7 +350,7 @@ const OrderSummaryUI = (props: any) => {
349
350
  <OText size={12}>{t('COMMENTS', 'Comments')}</OText>
350
351
  <View style={{ flex: 1, width: '100%' }}>
351
352
  <OInput
352
- value={cart?.comment}
353
+ value={comment || cart?.comment}
353
354
  placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
354
355
  onChange={(value: string) => handleChangeComment(value)}
355
356
  style={{
@@ -416,6 +417,7 @@ const OrderSummaryUI = (props: any) => {
416
417
  export const OrderSummary = (props: any) => {
417
418
  const orderSummaryProps = {
418
419
  ...props,
420
+ disablePreviousComment: true,
419
421
  UIComponent: OrderSummaryUI
420
422
  }
421
423