ordering-ui-react-native 0.14.71 → 0.14.74

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 (31) hide show
  1. package/package.json +1 -1
  2. package/themes/kiosk/index.tsx +6 -0
  3. package/themes/kiosk/src/components/BusinessController/index.tsx +67 -0
  4. package/themes/kiosk/src/components/BusinessController/styles.tsx +23 -0
  5. package/themes/kiosk/src/components/BusinessesListing/index.tsx +119 -0
  6. package/themes/kiosk/src/components/BusinessesListing/styles.tsx +24 -0
  7. package/themes/kiosk/src/components/LoginForm/index.tsx +62 -2
  8. package/themes/kiosk/src/components/LogoutButton/index.tsx +74 -0
  9. package/themes/kiosk/src/components/LogoutPopup/index.tsx +19 -7
  10. package/themes/kiosk/src/types/index.d.ts +1 -0
  11. package/themes/original/src/components/BusinessInformation/index.tsx +7 -2
  12. package/themes/original/src/components/BusinessesListing/index.tsx +8 -9
  13. package/themes/original/src/components/Cart/index.tsx +8 -8
  14. package/themes/original/src/components/Checkout/index.tsx +82 -70
  15. package/themes/original/src/components/LoginForm/index.tsx +6 -4
  16. package/themes/original/src/components/OrderDetails/index.tsx +58 -6
  17. package/themes/original/src/components/OrderProgress/index.tsx +39 -31
  18. package/themes/original/src/components/OrderSummary/index.tsx +8 -8
  19. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  20. package/themes/original/src/components/PhoneInputNumber/styles.tsx +1 -1
  21. package/themes/original/src/components/ProductForm/index.tsx +2 -2
  22. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  23. package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
  24. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -1
  25. package/themes/original/src/components/SingleProductCard/index.tsx +15 -8
  26. package/themes/original/src/components/UpsellingProducts/index.tsx +1 -4
  27. package/themes/original/src/components/UserProfile/index.tsx +13 -11
  28. package/themes/original/src/components/WalletTransactionItem/index.tsx +5 -5
  29. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  30. package/themes/original/src/components/shared/OInput.tsx +6 -2
  31. package/themes/original/src/utils/index.tsx +7 -0
@@ -135,14 +135,21 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
135
135
  {product?.description}
136
136
  </OText>
137
137
  </CardInfo>
138
- <FastImage
139
- style={styles.productStyle}
140
- source={{
141
- uri: optimizeImage(product?.images, 'h_75,c_limit'),
142
- priority: FastImage.priority.normal,
143
- }}
144
- resizeMode={FastImage.resizeMode.cover}
145
- />
138
+ {product?.images ? (
139
+ <FastImage
140
+ style={styles.productStyle}
141
+ source={{
142
+ uri: optimizeImage(product?.images, 'h_75,c_limit'),
143
+ priority: FastImage.priority.normal,
144
+ }}
145
+ resizeMode={FastImage.resizeMode.cover}
146
+ />
147
+ ) : (
148
+ <OIcon
149
+ src={theme?.images?.dummies?.product}
150
+ style={styles.productStyle}
151
+ />
152
+ )}
146
153
  {(isSoldOut || maxProductQuantity <= 0) && (
147
154
  <SoldOut>
148
155
  <OText size={12} weight="bold" color={theme.colors.textSecondary} style={styles.soldOutTextStyle}>
@@ -155,9 +155,6 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
155
155
  <TopActions onPress={() => onGoBack()}>
156
156
  <OIcon src={theme.images.general.arrow_left} width={15} />
157
157
  </TopActions>
158
- <TopActions style={styles.cancelBtn} onPress={() => handleUpsellingPage()}>
159
- <OText size={12} color={theme.colors.textSecondary}>{t('CANCEL', 'Cancel')}</OText>
160
- </TopActions>
161
158
  </TopBar>
162
159
  <ScrollView style={{ marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
163
160
  <View style={{ paddingHorizontal: 40 }}>
@@ -178,7 +175,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
178
175
  <View
179
176
  style={{
180
177
  alignItems: 'center',
181
- bottom: props.isPage ? 20 : Platform.OS === 'ios' ? bottom + 59 : bottom + 125
178
+ bottom: props.isPage ? Platform.OS === 'ios' ? 0 : 20 : Platform.OS === 'ios' ? bottom + 59 : bottom + 125
182
179
  }}
183
180
  >
184
181
  <OButton
@@ -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
  }