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.
- package/package.json +1 -1
- package/src/components/Checkout/index.tsx +1 -0
- package/src/components/PaymentOptions/index.tsx +15 -6
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/StripeElementsForm/index.tsx +48 -27
- package/src/components/StripeMethodForm/index.tsx +163 -0
- package/src/config.json +2 -0
- package/src/types/index.tsx +9 -0
- package/themes/kiosk/src/components/BusinessController/index.tsx +67 -0
- package/themes/kiosk/src/components/BusinessController/styles.tsx +23 -0
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +119 -0
- package/themes/kiosk/src/components/BusinessesListing/styles.tsx +24 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +62 -2
- package/themes/kiosk/src/components/LogoutButton/index.tsx +74 -0
- package/themes/kiosk/src/types/index.d.ts +1 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +32 -1
- package/themes/original/src/components/BusinessInformation/index.tsx +7 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +8 -9
- package/themes/original/src/components/Cart/index.tsx +8 -8
- package/themes/original/src/components/Checkout/index.tsx +82 -70
- package/themes/original/src/components/LoginForm/index.tsx +6 -4
- package/themes/original/src/components/OrderDetails/index.tsx +58 -6
- package/themes/original/src/components/OrderProgress/index.tsx +39 -31
- package/themes/original/src/components/OrderSummary/index.tsx +8 -8
- package/themes/original/src/components/OrdersOption/index.tsx +40 -16
- package/themes/original/src/components/OrdersOption/styles.tsx +5 -0
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PhoneInputNumber/styles.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +42 -11
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +15 -8
- package/themes/original/src/components/UpsellingProducts/index.tsx +1 -4
- package/themes/original/src/components/UserProfile/index.tsx +13 -11
- package/themes/original/src/components/WalletTransactionItem/index.tsx +5 -5
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/shared/OInput.tsx +6 -2
- package/themes/original/src/utils/index.tsx +7 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useLanguage,
|
|
6
6
|
ToastType,
|
|
7
7
|
useToast,
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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}
|
|
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}>{
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
|
28
|
-
: `:author
|
|
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:
|
|
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.
|
|
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={
|
|
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
|
}
|