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.
- package/package.json +1 -1
- package/themes/kiosk/index.tsx +6 -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/components/LogoutPopup/index.tsx +19 -7
- package/themes/kiosk/src/types/index.d.ts +1 -0
- 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/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PhoneInputNumber/styles.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +2 -2
- 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
|
@@ -135,14 +135,21 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
135
135
|
{product?.description}
|
|
136
136
|
</OText>
|
|
137
137
|
</CardInfo>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
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
|
}
|