ordering-ui-react-native 0.17.85 → 0.17.87
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/business/src/components/MapView/index.tsx +2 -2
- package/themes/business/src/components/ProductItemAccordion/index.tsx +21 -3
- package/themes/original/src/components/AddressForm/index.tsx +26 -22
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +91 -70
- package/themes/original/src/components/BusinessController/index.tsx +71 -49
- package/themes/original/src/components/BusinessProductsListing/index.tsx +32 -44
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +48 -30
- package/themes/original/src/components/Cart/index.tsx +36 -71
- package/themes/original/src/components/CartContent/index.tsx +47 -2
- package/themes/original/src/components/CartContent/styles.tsx +10 -0
- package/themes/original/src/components/Checkout/index.tsx +40 -32
- package/themes/original/src/components/Messages/index.tsx +8 -7
- package/themes/original/src/components/MultiCart/index.tsx +41 -54
- package/themes/original/src/components/MultiCheckout/index.tsx +2 -7
- package/themes/original/src/components/MyOrders/index.tsx +9 -7
- package/themes/original/src/components/OrderDetails/index.tsx +99 -73
- package/themes/original/src/components/OrderTypeSelector/index.tsx +6 -4
- package/themes/original/src/components/PageBanner/index.tsx +60 -33
- package/themes/original/src/components/PageBanner/styles.tsx +0 -7
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +2 -2
- package/themes/original/src/components/SingleOrderCard/index.tsx +58 -44
- package/themes/original/src/components/SingleProductCard/index.tsx +51 -21
- package/themes/original/src/components/SingleProductCard/styles.tsx +11 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +243 -216
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserProfile/index.tsx +82 -53
- package/themes/original/src/components/shared/OButton.tsx +5 -1
- package/themes/original/src/components/shared/OInput.tsx +8 -2
- package/themes/original/src/types/index.tsx +3 -0
- package/themes/original/src/utils/index.tsx +11 -0
|
@@ -50,7 +50,18 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
50
50
|
const theme = useTheme();
|
|
51
51
|
|
|
52
52
|
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
53
|
-
|
|
53
|
+
const hideProfileImage = theme?.profile?.components?.picture?.hidden
|
|
54
|
+
const hideOrders = theme?.profile?.components?.orders?.hidden
|
|
55
|
+
const hideProfile = theme?.profile?.components?.profile?.hidden
|
|
56
|
+
const hideWallet = theme?.profile?.components?.wallet?.hidden
|
|
57
|
+
const hideMessages = theme?.bar_menu?.components?.messages?.hidden
|
|
58
|
+
const hideHelp = theme?.bar_menu?.components?.help?.hidden
|
|
59
|
+
const hideFavorites = theme?.bar_menu?.components?.favortes?.hidden
|
|
60
|
+
const hideSession = theme?.bar_menu?.components?.sessions?.hidden
|
|
61
|
+
const hidePromotions = theme?.bar_menu?.components?.promotions?.hidden
|
|
62
|
+
const hideAddressList = theme?.profile?.components?.address_list?.hidden
|
|
63
|
+
const showLanguages = !theme?.profile?.components?.languages?.hidden
|
|
64
|
+
const showNotifications = !theme?.profile?.components?.notification_settings?.hidden
|
|
54
65
|
const langPickerStyle = StyleSheet.create({
|
|
55
66
|
inputAndroid: {
|
|
56
67
|
color: theme.colors.textNormal,
|
|
@@ -166,7 +177,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
166
177
|
return (
|
|
167
178
|
<View style={{ flex: 1, height: height - top - bottom, paddingTop: 20 }}>
|
|
168
179
|
<CenterView style={styles.pagePadding}>
|
|
169
|
-
{user?.photo && (
|
|
180
|
+
{user?.photo && !hideProfileImage && (
|
|
170
181
|
<View style={styles.photo}>
|
|
171
182
|
<FastImage
|
|
172
183
|
style={{ height: 60, width: 60, borderRadius: 8 }}
|
|
@@ -180,76 +191,94 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
180
191
|
)}
|
|
181
192
|
<View style={{ flexBasis: '70%' }}>
|
|
182
193
|
<OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
|
|
183
|
-
|
|
184
|
-
<
|
|
185
|
-
|
|
194
|
+
{!hideProfile && (
|
|
195
|
+
<TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
|
|
196
|
+
<OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
|
|
197
|
+
</TouchableOpacity>
|
|
198
|
+
)}
|
|
186
199
|
</View>
|
|
187
200
|
</CenterView>
|
|
188
201
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32 }} />
|
|
189
202
|
<Spinner visible={notificationsGroup?.loading} />
|
|
190
203
|
<ListWrap style={{ ...styles.pagePadding }}>
|
|
191
204
|
<Actions>
|
|
192
|
-
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
{
|
|
205
|
+
{!hideAddressList && (
|
|
206
|
+
<ListItem onPress={() => onRedirect('AddressList', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
207
|
+
<OIcon src={theme.images.general.pin} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
208
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SAVED_PLACES', 'My saved places')}</OText>
|
|
209
|
+
</ListItem>
|
|
210
|
+
)}
|
|
211
|
+
{!hideMessages && (
|
|
212
|
+
<ListItem onPress={() => onRedirect('Messages', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
213
|
+
<MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
214
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
|
|
215
|
+
</ListItem>
|
|
216
|
+
)}
|
|
217
|
+
{!hideOrders && (
|
|
218
|
+
<ListItem onPress={() => onRedirect('MyOrders', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
219
|
+
<FontAwesome name='list-alt' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
220
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_ORDERS', 'My Orders')}</OText>
|
|
221
|
+
</ListItem>
|
|
222
|
+
)}
|
|
223
|
+
{isWalletEnabled && !hideWallet && (
|
|
205
224
|
<ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
206
225
|
<Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
207
226
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
|
|
208
227
|
</ListItem>
|
|
209
228
|
)}
|
|
210
|
-
{IsPromotionsEnabled && (
|
|
229
|
+
{IsPromotionsEnabled && !hidePromotions && (
|
|
211
230
|
<ListItem onPress={() => onRedirect('Promotions', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
212
231
|
<MaterialIcons name='local-offer' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
213
232
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('PROMOTIONS', 'Promotions')}</OText>
|
|
214
233
|
</ListItem>
|
|
215
234
|
)}
|
|
216
|
-
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
<
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
235
|
+
{!hideHelp && (
|
|
236
|
+
<ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
|
|
237
|
+
<OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
238
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
|
|
239
|
+
</ListItem>
|
|
240
|
+
)}
|
|
241
|
+
{!showNotifications && (
|
|
242
|
+
<ListItem onPress={() => navigation.navigate('Notifications', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
243
|
+
<NotificationBadge style={{ borderRadius: 100 / 2 }} />
|
|
244
|
+
<Ionicons name='notifications-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
245
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('NOTIFICATIONS', 'Notifications')}
|
|
246
|
+
</OText>
|
|
247
|
+
<NotificationsWrapper>
|
|
248
|
+
<ToggleSwitch
|
|
249
|
+
isOn={user && (!!user?.settings?.notification?.newsletter ||
|
|
250
|
+
!!user?.settings?.sms?.newsletter ||
|
|
251
|
+
!!user?.settings?.email?.newsletter)}
|
|
252
|
+
onColor={theme.colors.primary}
|
|
253
|
+
size="small"
|
|
254
|
+
disabled={notificationsGroup?.loading}
|
|
255
|
+
offColor={theme.colors.disabled}
|
|
256
|
+
animationSpeed={400}
|
|
257
|
+
onToggle={() => handleChangePromotions(!(user && (!!user?.settings?.notification?.newsletter ||
|
|
258
|
+
!!user?.settings?.sms?.newsletter ||
|
|
259
|
+
!!user?.settings?.email?.newsletter)))}
|
|
260
|
+
/>
|
|
261
|
+
</NotificationsWrapper>
|
|
262
|
+
</ListItem>
|
|
263
|
+
)}
|
|
264
|
+
{!hideSession && (
|
|
265
|
+
<ListItem onPress={() => navigation.navigate('Sessions')} activeOpacity={0.7}>
|
|
266
|
+
<Ionicons name='md-list-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
267
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SESSIONS', 'Sessions')}</OText>
|
|
268
|
+
</ListItem>
|
|
269
|
+
)}
|
|
270
|
+
{!hideFavorites && (
|
|
271
|
+
<ListItem onPress={() => navigation.navigate('Favorite')} activeOpacity={0.7}>
|
|
272
|
+
<Ionicons name='heart-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
273
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('FAVORITES', 'Favorites')}</OText>
|
|
274
|
+
</ListItem>
|
|
275
|
+
)}
|
|
249
276
|
</Actions>
|
|
250
277
|
|
|
251
278
|
<Actions>
|
|
252
|
-
|
|
279
|
+
{!showLanguages && (
|
|
280
|
+
<LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} />
|
|
281
|
+
)}
|
|
253
282
|
<View style={{ height: 17 }} />
|
|
254
283
|
<LogoutButton color={theme.colors.textNormal} text={t('LOGOUT', 'Logout')} />
|
|
255
284
|
<View style={{ height: 17 }} />
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import styled, { useTheme } from 'styled-components/native';
|
|
14
14
|
import { OIcon } from './';
|
|
15
|
+
import { css } from 'styled-components';
|
|
15
16
|
|
|
16
17
|
const StyledButton = styled.View<Props>`
|
|
17
18
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
@@ -26,6 +27,9 @@ const StyledButton = styled.View<Props>`
|
|
|
26
27
|
padding-left: 20px;
|
|
27
28
|
padding-right: 20px;
|
|
28
29
|
position: relative;
|
|
30
|
+
${(props : any) => props?.theme?.general?.components?.buttons?.borderRadius && css`
|
|
31
|
+
border-radius: ${props?.theme?.general?.components?.buttons?.borderRadius};
|
|
32
|
+
`}
|
|
29
33
|
`
|
|
30
34
|
const StyledButtonDisabled = styled(StyledButton)`
|
|
31
35
|
background-color: ${(props: any) => props.theme.colors.disabled};
|
|
@@ -120,7 +124,7 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
120
124
|
<props.icon {...props.iconProps} />
|
|
121
125
|
) : null}
|
|
122
126
|
{props.imgLeftSrc ? (
|
|
123
|
-
<OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} />
|
|
127
|
+
<OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} color={theme.colors.textNormal} />
|
|
124
128
|
) : null}
|
|
125
129
|
{props.text ? (
|
|
126
130
|
<StyledText style={props.textStyle}>{props.text}</StyledText>
|
|
@@ -3,7 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
|
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
4
|
import OIcon from './OIcon';
|
|
5
5
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
6
|
-
import { useTheme } from 'styled-components/native';
|
|
6
|
+
import { useTheme, css } from 'styled-components/native';
|
|
7
7
|
|
|
8
8
|
const Input = styled.TextInput`
|
|
9
9
|
flex-grow: 1;
|
|
@@ -53,6 +53,9 @@ const Wrapper = styled.Pressable`
|
|
|
53
53
|
align-items: center;
|
|
54
54
|
justify-content: center;
|
|
55
55
|
width: 100%;
|
|
56
|
+
${(props: any) => props.theme?.general?.components?.inputs?.borderRadius && css`
|
|
57
|
+
border-radius: ${props?.theme?.general?.components?.inputs?.borderRadius};
|
|
58
|
+
`}
|
|
56
59
|
`;
|
|
57
60
|
|
|
58
61
|
const OInput = (props: Props): React.ReactElement => {
|
|
@@ -100,7 +103,10 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
100
103
|
ref={(e: any) => {
|
|
101
104
|
props.forwardRef && (props.forwardRef.current = e)
|
|
102
105
|
}}
|
|
103
|
-
style={
|
|
106
|
+
style={{
|
|
107
|
+
color: theme?.general?.components?.inputs?.color,
|
|
108
|
+
...props?.inputStyle
|
|
109
|
+
}}
|
|
104
110
|
onFocus={() => setInputFocused(true)}
|
|
105
111
|
onBlur={() => setInputFocused(false)}
|
|
106
112
|
/>
|
|
@@ -318,6 +318,7 @@ export interface SingleProductCardParams {
|
|
|
318
318
|
navigation?: any;
|
|
319
319
|
isPreviously?: any;
|
|
320
320
|
isProductId?: any;
|
|
321
|
+
viewString?: string;
|
|
321
322
|
}
|
|
322
323
|
export interface BusinessInformationParams {
|
|
323
324
|
navigation?: any,
|
|
@@ -594,6 +595,8 @@ export interface UpsellingProductsParams {
|
|
|
594
595
|
products?: any;
|
|
595
596
|
onNavigationRedirect?: any;
|
|
596
597
|
onGoBack?: any;
|
|
598
|
+
singleBusiness?: any;
|
|
599
|
+
isFranchiseApp?: any;
|
|
597
600
|
}
|
|
598
601
|
|
|
599
602
|
export interface GoogleMapsParams {
|
|
@@ -355,6 +355,17 @@ export const priceList = [
|
|
|
355
355
|
{ level: '5', content: '$$$$$' }
|
|
356
356
|
]
|
|
357
357
|
|
|
358
|
+
export const getLogisticTag = (status: any) => {
|
|
359
|
+
const keyList: any = {
|
|
360
|
+
0: t('PENDING', 'Pending'),
|
|
361
|
+
1: t('IN_PROGRESS', 'In progress'),
|
|
362
|
+
2: t('IN_QUEUE', 'In queue'),
|
|
363
|
+
3: t('EXPIRED', 'Expired'),
|
|
364
|
+
4: t('RESOLVED', 'Resolved'),
|
|
365
|
+
}
|
|
366
|
+
return keyList[status] ? keyList[status] : t('UNKNOWN', 'Unknown')
|
|
367
|
+
}
|
|
368
|
+
|
|
358
369
|
export const getOrderStatus = (s: string) => {
|
|
359
370
|
const status = parseInt(s);
|
|
360
371
|
const orderStatus = [
|