ordering-ui-react-native 0.14.69 → 0.14.72

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.
Files changed (39) hide show
  1. package/package.json +1 -1
  2. package/src/components/Checkout/index.tsx +1 -0
  3. package/src/components/PaymentOptions/index.tsx +15 -6
  4. package/src/components/ProductForm/index.tsx +1 -1
  5. package/src/components/StripeElementsForm/index.tsx +48 -27
  6. package/src/components/StripeMethodForm/index.tsx +163 -0
  7. package/src/config.json +2 -0
  8. package/src/types/index.tsx +9 -0
  9. package/themes/kiosk/src/components/BusinessController/index.tsx +67 -0
  10. package/themes/kiosk/src/components/BusinessController/styles.tsx +23 -0
  11. package/themes/kiosk/src/components/BusinessesListing/index.tsx +119 -0
  12. package/themes/kiosk/src/components/BusinessesListing/styles.tsx +24 -0
  13. package/themes/kiosk/src/components/LoginForm/index.tsx +62 -2
  14. package/themes/kiosk/src/components/LogoutButton/index.tsx +74 -0
  15. package/themes/kiosk/src/types/index.d.ts +1 -0
  16. package/themes/original/src/components/BusinessBasicInformation/index.tsx +32 -1
  17. package/themes/original/src/components/BusinessInformation/index.tsx +7 -2
  18. package/themes/original/src/components/BusinessesListing/index.tsx +8 -9
  19. package/themes/original/src/components/Cart/index.tsx +8 -8
  20. package/themes/original/src/components/Checkout/index.tsx +82 -70
  21. package/themes/original/src/components/LoginForm/index.tsx +6 -4
  22. package/themes/original/src/components/OrderDetails/index.tsx +58 -6
  23. package/themes/original/src/components/OrderProgress/index.tsx +39 -31
  24. package/themes/original/src/components/OrderSummary/index.tsx +8 -8
  25. package/themes/original/src/components/OrdersOption/index.tsx +40 -16
  26. package/themes/original/src/components/OrdersOption/styles.tsx +5 -0
  27. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  28. package/themes/original/src/components/PhoneInputNumber/styles.tsx +1 -1
  29. package/themes/original/src/components/ProductForm/index.tsx +42 -11
  30. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  31. package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
  32. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -1
  33. package/themes/original/src/components/SingleProductCard/index.tsx +15 -8
  34. package/themes/original/src/components/UpsellingProducts/index.tsx +1 -4
  35. package/themes/original/src/components/UserProfile/index.tsx +13 -11
  36. package/themes/original/src/components/WalletTransactionItem/index.tsx +5 -5
  37. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  38. package/themes/original/src/components/shared/OInput.tsx +6 -2
  39. package/themes/original/src/utils/index.tsx +7 -0
@@ -5,7 +5,7 @@ import {
5
5
  useLanguage,
6
6
  ToastType,
7
7
  useToast,
8
- useConfig
8
+ useConfig
9
9
  } from 'ordering-components/native';
10
10
  import { useTheme } from 'styled-components/native';
11
11
  import { useForm } from 'react-hook-form';
@@ -85,7 +85,7 @@ const ProfileListUI = (props: ProfileParams) => {
85
85
  messageIconStyle: {
86
86
  fontSize: 18,
87
87
  fontWeight: 'bold',
88
- marginEnd: 14
88
+ marginEnd: 14
89
89
  }
90
90
  });
91
91
 
@@ -99,7 +99,7 @@ const ProfileListUI = (props: ProfileParams) => {
99
99
  const { height } = useWindowDimensions();
100
100
  const { top, bottom } = useSafeAreaInsets();
101
101
 
102
- const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
102
+ const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
103
103
 
104
104
  const onRedirect = (route: string, params?: any) => {
105
105
  navigation.navigate(route, params)
@@ -136,7 +136,9 @@ const ProfileListUI = (props: ProfileParams) => {
136
136
 
137
137
  return (
138
138
  <View style={{ flex: 1, height: height - top - bottom - 62 }}>
139
- <OText size={24} color={theme.colors.textNormal} lineHeight={36} weight={Platform.OS === 'ios' ? '600' : 'bold'} style={{ marginTop: 14, marginBottom: 24, ...styles.pagePadding }}>{t('PROFILE', 'Profile')}</OText>
139
+ <OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
140
+ {t('PROFILE', 'Profile')}
141
+ </OText>
140
142
  <CenterView style={styles.pagePadding}>
141
143
  <View style={styles.photo}>
142
144
  <OIcon
@@ -147,7 +149,7 @@ const ProfileListUI = (props: ProfileParams) => {
147
149
  />
148
150
  </View>
149
151
  <View style={{ flexBasis: '70%' }}>
150
- <OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{`${user?.name} ${user?.lastname}`}</OText>
152
+ <OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
151
153
  <TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
152
154
  <OText size={12} lineHeight={18} color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
153
155
  </TouchableOpacity>
@@ -165,12 +167,12 @@ const ProfileListUI = (props: ProfileParams) => {
165
167
  <MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
166
168
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
167
169
  </ListItem>
168
- {!isWalletEnabled && (
169
- <ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
170
- <Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
171
- <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
172
- </ListItem>
173
- )}
170
+ {isWalletEnabled && (
171
+ <ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
172
+ <Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
173
+ <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
174
+ </ListItem>
175
+ )}
174
176
  <ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
175
177
  <OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
176
178
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
@@ -22,10 +22,10 @@ export const WalletTransactionItem = (props: any) => {
22
22
  const [{ parsePrice, parseDate }] = useUtils()
23
23
  const [, t] = useLanguage()
24
24
 
25
- const LANG_EVENT_KEY = `WALLET_${type.toUpperCase()}_${item?.event.toUpperCase()}_${item?.event_type.toUpperCase()}_${item?.amount >= 0 ? 'POSITIVE': 'NEGATIVE'}`
25
+ const LANG_EVENT_KEY = `WALLET_${type.toUpperCase()}_${item?.event.toUpperCase()}_${item?.event_type.toUpperCase()}_${item?.amount >= 0 ? 'POSITIVE' : 'NEGATIVE'}`
26
26
  const lang_event_text = !!item?.event?.order_id
27
- ? `:author ${item?.amount >= 0 ? 'add' : 'reduce'} money in Order No. :order_id`
28
- : `:author ${item?.amount >= 0 ? 'add' : 'reduce'} money`
27
+ ? `:author${item?.amount >= 0 ? 'Add' : 'Reduce'} money in Order No. :order_id`
28
+ : `:author${item?.amount >= 0 ? 'Add' : 'Reduce'} money`
29
29
 
30
30
  return (
31
31
  <Container>
@@ -44,8 +44,8 @@ export const WalletTransactionItem = (props: any) => {
44
44
  <MessageBlock>
45
45
  <OText>
46
46
  {t(LANG_EVENT_KEY, lang_event_text)
47
- .replace(':author', item?.event?.author?.name ?? '')
48
- .replace(':order_id', item?.event?.order_id ?? '')}
47
+ .replace(':author', item?.event?.author?.name ? item?.event?.author?.name + ' ' : '')
48
+ .replace(':order_id', item?.event?.order_id ? item?.event?.order_id + ' ' : '')}
49
49
  </OText>
50
50
  </MessageBlock>
51
51
  {!!item?.description && (
@@ -27,7 +27,7 @@ export const BalanceElement = styled.View`
27
27
  display: flex;
28
28
  flex-direction: row;
29
29
  justify-content: center;
30
- align-items: flex-end;
30
+ align-items: center;
31
31
  background-color: ${(props: any) => props.theme.colors.backgroundGray100};
32
32
  border-radius: 8px;
33
33
  `
@@ -37,9 +37,10 @@ interface Props extends TextInputProps {
37
37
  vectorIconColor?: string;
38
38
  forwardRef?: any;
39
39
  inputStyle?: TextStyle;
40
+ wrapperRef?: any;
40
41
  }
41
42
 
42
- const Wrapper = styled.View`
43
+ const Wrapper = styled.Pressable`
43
44
  background-color: ${(props: any) => props.theme.colors.backgroundLight};
44
45
  border-radius: 25px;
45
46
  border-width: 1px;
@@ -54,6 +55,7 @@ const Wrapper = styled.View`
54
55
  const OInput = (props: Props): React.ReactElement => {
55
56
  return (
56
57
  <Wrapper
58
+ onPress={() => props.forwardRef?.current?.focus?.()}
57
59
  style={{
58
60
  backgroundColor: props.bgColor,
59
61
  borderColor: props.borderColor,
@@ -87,7 +89,9 @@ const OInput = (props: Props): React.ReactElement => {
87
89
  returnKeyType={props.returnKeyType}
88
90
  onSubmitEditing={props.onSubmitEditing}
89
91
  blurOnSubmit={props.blurOnSubmit}
90
- ref={props.forwardRef}
92
+ ref={(e : any) => {
93
+ props.forwardRef.current = e
94
+ }}
91
95
  style={props?.inputStyle}
92
96
  />
93
97
  {props.iconRight && (
@@ -195,4 +195,11 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
195
195
  const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(curLat1) * Math.cos(curLat2)
196
196
  const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
197
197
  return R * c
198
+ }
199
+
200
+ export const formatUrlVideo = (url : string) => {
201
+ const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
202
+ const match = url.match(regExp)
203
+ const id = (match && match[7].length === 11) ? match[7] : false
204
+ return `https://www.youtube-nocookie.com/embed/${id}`
198
205
  }