ordering-ui-react-native 0.21.37 → 0.21.38

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.21.37",
3
+ "version": "0.21.38",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -11,6 +11,7 @@ import {
11
11
  useLanguage,
12
12
  ToastType,
13
13
  useToast,
14
+ useSession
14
15
  } from 'ordering-components/native';
15
16
  import { useTheme } from 'styled-components/native';
16
17
  import { PaymentOptionCash } from '../PaymentOptionCash';
@@ -78,6 +79,7 @@ const PaymentOptionsUI = (props: any) => {
78
79
 
79
80
  const theme = useTheme();
80
81
  const [, { showToast }] = useToast();
82
+ const [{ user }] = useSession()
81
83
  const { confirmApplePayPayment } = useApplePay()
82
84
 
83
85
  const getPayIcon = (method: string) => {
@@ -120,7 +122,7 @@ const PaymentOptionsUI = (props: any) => {
120
122
  const paymethodsFieldRequired = ['paypal', 'apple_pay', 'global_apple_pay']
121
123
 
122
124
  const handlePaymentMethodClick = (paymethod: any) => {
123
- if (cart?.balance > 0) {
125
+ if (cart?.balance > 0 || !!user?.guest_id) {
124
126
  if (paymethodsFieldRequired.includes(paymethod?.gateway) && requiredFields.length > 0) {
125
127
  openUserModal && openUserModal(true)
126
128
  setPaymethodClicked({
@@ -505,7 +505,7 @@ export const ProductOptionsUI = (props: any) => {
505
505
  <TouchableOpacity style={{ marginTop: 10 }} onPress={handleUpdateGuest}>
506
506
  {actionStatus?.loading ? (
507
507
  <Placeholder Animation={Fade}>
508
- <PlaceholderLine width={60} height={20} />
508
+ <PlaceholderLine height={20} />
509
509
  </Placeholder>
510
510
  ) : (
511
511
  <OText color={theme.colors.primary} size={13} style={{ textAlign: 'center' }}>{t('AS_GUEST_USER', 'As guest user')}</OText>