ordering-ui-react-native 0.21.21 → 0.21.22-release
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 +7 -6
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +4 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +2 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +23 -14
- package/themes/business/src/components/DriverMap/index.tsx +4 -3
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +4 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +2 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +163 -113
- package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +60 -53
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +240 -76
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +125 -48
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +33 -36
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +18 -13
- package/themes/business/src/components/PreviousOrders/index.tsx +80 -66
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +98 -44
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +15 -2
- package/themes/business/src/utils/index.tsx +5 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +9 -4
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +10 -6
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +20 -12
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +51 -20
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +24 -404
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +32 -9
- package/themes/original/src/components/CartContent/index.tsx +96 -58
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +190 -66
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +33 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +4 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +6 -5
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +2 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +4 -3
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
- package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
- package/themes/original/src/components/MyOrders/index.tsx +24 -29
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +716 -668
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +28 -6
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +3 -5
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +72 -6
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +74 -165
- package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SignupForm/index.tsx +60 -58
- package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
- package/themes/original/src/components/StripeElementsForm/index.tsx +72 -59
- package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +125 -77
- package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
- package/themes/original/src/components/UserProfile/index.tsx +3 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +1 -0
- package/themes/original/src/utils/index.tsx +125 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { View, TouchableOpacity, Platform, StyleSheet } from 'react-native'
|
|
3
|
+
import { useLanguage, useSession, useUtils, Sessions as SessionsController } from 'ordering-components/native'
|
|
4
|
+
import { SessionsParams } from '../../types'
|
|
5
|
+
import { OAlert } from '../../../../../src/components/shared'
|
|
6
|
+
import { OButton, OIcon, OText } from '../shared'
|
|
7
|
+
import { useTheme } from 'styled-components/native'
|
|
8
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
9
|
+
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
SessionsWrapper,
|
|
13
|
+
SessionItem,
|
|
14
|
+
DurationWrapper,
|
|
15
|
+
Container
|
|
16
|
+
} from './styles'
|
|
17
|
+
|
|
18
|
+
export const SessionsUI = (props: SessionsParams) => {
|
|
19
|
+
const {
|
|
20
|
+
navigation,
|
|
21
|
+
sessionsList,
|
|
22
|
+
actionState,
|
|
23
|
+
handleDeleteSession,
|
|
24
|
+
handleDeleteAllSessions
|
|
25
|
+
} = props
|
|
26
|
+
|
|
27
|
+
const [, t] = useLanguage()
|
|
28
|
+
const [{ user }] = useSession()
|
|
29
|
+
const [{ parseDate }] = useUtils()
|
|
30
|
+
const theme = useTheme()
|
|
31
|
+
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
32
|
+
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
33
|
+
|
|
34
|
+
const onDeleteSession = (session: any) => {
|
|
35
|
+
setConfirm({
|
|
36
|
+
open: true,
|
|
37
|
+
title: t('WEB_APPNAME', 'Ordering'),
|
|
38
|
+
content: [t('QUESTION_DELETE_SESSION', 'Are you sure to delete this session?')],
|
|
39
|
+
handleOnAccept: () => {
|
|
40
|
+
handleDeleteSession(session)
|
|
41
|
+
setConfirm({ ...confirm, open: false })
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const onDeleteAllSessions = (isOldUser: any, deleteCurrent: any) => {
|
|
47
|
+
setConfirm({
|
|
48
|
+
open: true,
|
|
49
|
+
title: t('WEB_APPNAME', 'Ordering'),
|
|
50
|
+
content:
|
|
51
|
+
isOldUser
|
|
52
|
+
? [t('QUESTION_ENABLE_ALL_SESSIONS', 'Are you sure to enable all sessions?')]
|
|
53
|
+
: deleteCurrent
|
|
54
|
+
? [t('QUESTION_DELETE_ALL_SESSIONS', 'Are you sure that you want to delete all sessions?')]
|
|
55
|
+
: [t('QUESTION_DELETE_ALL_SESSIONS_EXCEPT_CURRENT', 'Are you sure that you want to delete all sessions except current?')],
|
|
56
|
+
handleOnAccept: () => {
|
|
57
|
+
handleDeleteAllSessions(deleteCurrent)
|
|
58
|
+
setConfirm({ ...confirm, open: false })
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
titleGroups: {
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
flexDirection: 'row',
|
|
67
|
+
minHeight: 33,
|
|
68
|
+
},
|
|
69
|
+
btnBackArrow: {
|
|
70
|
+
borderWidth: 0,
|
|
71
|
+
width: 32,
|
|
72
|
+
height: 32,
|
|
73
|
+
tintColor: theme.colors.textGray,
|
|
74
|
+
backgroundColor: theme.colors.clear,
|
|
75
|
+
borderColor: theme.colors.clear,
|
|
76
|
+
shadowColor: theme.colors.clear,
|
|
77
|
+
paddingLeft: 0,
|
|
78
|
+
paddingRight: 0,
|
|
79
|
+
marginTop: Platform.OS === 'ios' ? 30 : 10
|
|
80
|
+
},
|
|
81
|
+
innerPadding: {
|
|
82
|
+
paddingLeft: 10,
|
|
83
|
+
paddingRight: 10
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Container
|
|
89
|
+
pdng={Platform.OS === 'ios' ? '10px' : '8px'}
|
|
90
|
+
style={styles.innerPadding}
|
|
91
|
+
>
|
|
92
|
+
<View style={styles.titleGroups}>
|
|
93
|
+
<TouchableOpacity onPress={() => goToBack()} style={styles.btnBackArrow}>
|
|
94
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
95
|
+
</TouchableOpacity>
|
|
96
|
+
</View>
|
|
97
|
+
<OText size={24} style={{ paddingTop: 12 }}>
|
|
98
|
+
{t('SESSIONS', 'Sessions')}
|
|
99
|
+
</OText>
|
|
100
|
+
{user?.session_strategy === 'jwt_session' ? (
|
|
101
|
+
<>
|
|
102
|
+
{sessionsList.loading ? (
|
|
103
|
+
[...Array(5).keys()].map(i => (
|
|
104
|
+
<SessionItem key={i}>
|
|
105
|
+
<Placeholder Animation={Fade}>
|
|
106
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
107
|
+
<View style={{ flex: 1 }}>
|
|
108
|
+
<PlaceholderLine width={40} />
|
|
109
|
+
<PlaceholderLine width={40} />
|
|
110
|
+
</View>
|
|
111
|
+
<PlaceholderLine width={5} />
|
|
112
|
+
</View>
|
|
113
|
+
</Placeholder>
|
|
114
|
+
</SessionItem>
|
|
115
|
+
))
|
|
116
|
+
) : (
|
|
117
|
+
sessionsList.sessions.length > 0 ? (
|
|
118
|
+
<SessionsWrapper>
|
|
119
|
+
{sessionsList.sessions.reverse().map((session: any) => (
|
|
120
|
+
<SessionItem key={session.id}>
|
|
121
|
+
<DurationWrapper>
|
|
122
|
+
<OText>{parseDate(session.created_at)}</OText>
|
|
123
|
+
<OText>{parseDate(session.valid_thru)}</OText>
|
|
124
|
+
</DurationWrapper>
|
|
125
|
+
{session.current && (
|
|
126
|
+
<OText mLeft={15} style={{ flex: 1 }}>({t('CURRENT', 'Current')})</OText>
|
|
127
|
+
)}
|
|
128
|
+
<TouchableOpacity
|
|
129
|
+
onPress={() => onDeleteSession(session)}
|
|
130
|
+
>
|
|
131
|
+
<AntIcon name='close' size={16} color={theme.colors.red} />
|
|
132
|
+
</TouchableOpacity>
|
|
133
|
+
</SessionItem>
|
|
134
|
+
))}
|
|
135
|
+
<OButton
|
|
136
|
+
text={t('DELETE_ALL_SESSIONS', 'Delete all sessions')}
|
|
137
|
+
isDisabled={actionState.loading}
|
|
138
|
+
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
139
|
+
onClick={() => onDeleteAllSessions(false, true)}
|
|
140
|
+
style={{ borderRadius: 7.6, marginTop: 30 }}
|
|
141
|
+
/>
|
|
142
|
+
<OButton
|
|
143
|
+
text={t('DELETE_ALL_SESSIONS_EXCEPT_CURRENT', 'Delete all sessions except current')}
|
|
144
|
+
isDisabled={actionState.loading}
|
|
145
|
+
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
146
|
+
onClick={() => onDeleteAllSessions(false, false)}
|
|
147
|
+
style={{ borderRadius: 7.6, marginTop: 20 }}
|
|
148
|
+
/>
|
|
149
|
+
</SessionsWrapper>
|
|
150
|
+
) : (
|
|
151
|
+
<OText>{t('YOU_DONT_HAVE_ANY_SESSIONS', 'You don\'t have any sessions')}</OText>
|
|
152
|
+
)
|
|
153
|
+
)}
|
|
154
|
+
</>
|
|
155
|
+
) : (
|
|
156
|
+
<View>
|
|
157
|
+
<OText>
|
|
158
|
+
{t('YOU_DONT_HAVE_ENABLED_THE_SESSIONS', 'You don\'t have enabled the sessions, please active them to have a better control of your sessions.')}
|
|
159
|
+
</OText>
|
|
160
|
+
<OButton
|
|
161
|
+
text={t('ACTIVE_SESSIONS', 'Active sessions')}
|
|
162
|
+
isDisabled={actionState.loading}
|
|
163
|
+
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
164
|
+
onClick={() => onDeleteAllSessions(true, false)}
|
|
165
|
+
style={{ borderRadius: 7.6, marginTop: 20 }}
|
|
166
|
+
/>
|
|
167
|
+
</View>
|
|
168
|
+
)}
|
|
169
|
+
<OAlert
|
|
170
|
+
open={confirm.open}
|
|
171
|
+
title={confirm.title}
|
|
172
|
+
content={confirm.content}
|
|
173
|
+
onAccept={confirm.handleOnAccept}
|
|
174
|
+
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
175
|
+
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
176
|
+
/>
|
|
177
|
+
</Container>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const Sessions = (props: SessionsParams) => {
|
|
182
|
+
const sessionsProps = {
|
|
183
|
+
...props,
|
|
184
|
+
UIComponent: SessionsUI
|
|
185
|
+
}
|
|
186
|
+
return <SessionsController {...sessionsProps} />
|
|
187
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const SessionsWrapper = styled.View`
|
|
4
|
+
`
|
|
5
|
+
export const SessionItem = styled.View`
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
padding-vertical: 15px;
|
|
10
|
+
border-bottom-color: ${(props: any) => props.theme.colors.lightGray};
|
|
11
|
+
border-bottom-width: 1px;
|
|
12
|
+
`
|
|
13
|
+
export const DurationWrapper = styled.View`
|
|
14
|
+
/* flex-direction: row; */
|
|
15
|
+
`
|
|
16
|
+
|
|
17
|
+
export const Container = styled.View`
|
|
18
|
+
padding-top: ${(props: any) => props.pdng};
|
|
19
|
+
margin-bottom: 50px;
|
|
20
|
+
`
|
|
@@ -133,7 +133,8 @@ const StoresListUI = (props: BusinessesListingParams) => {
|
|
|
133
133
|
lazyLoad
|
|
134
134
|
isCancelXButtonShow={!!searchValue}
|
|
135
135
|
onCancel={() => handleChangeSearch('')}
|
|
136
|
-
placeholder={t('
|
|
136
|
+
placeholder={t('SEARCH', 'Search')}
|
|
137
|
+
containerStyle={{ width: 210 }}
|
|
137
138
|
/>
|
|
138
139
|
</View>
|
|
139
140
|
)}
|
|
@@ -148,10 +149,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
|
|
|
148
149
|
width={12}
|
|
149
150
|
height={12}
|
|
150
151
|
color={theme.colors.skyBlue}
|
|
151
|
-
style={{ marginRight: 5
|
|
152
|
+
style={{ marginRight: 5 }}
|
|
152
153
|
/>
|
|
153
154
|
<OText size={12}>
|
|
154
|
-
{t('MORE_SETTINGS_GO_TO', 'For more settings go to')}
|
|
155
|
+
{t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
|
|
155
156
|
</OText>
|
|
156
157
|
<TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
|
|
157
158
|
<OText size={12} color={theme.colors.skyBlue}>
|
|
@@ -180,6 +181,7 @@ const StoresListUI = (props: BusinessesListingParams) => {
|
|
|
180
181
|
isBusinessOpen={business?.open}
|
|
181
182
|
setIsUpdateStore={setIsUpdateStore}
|
|
182
183
|
isUpdateStore={isUpdateStore}
|
|
184
|
+
navigation={navigation}
|
|
183
185
|
/>
|
|
184
186
|
))}
|
|
185
187
|
|
|
@@ -36,7 +36,8 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
36
36
|
handleCancelEdit,
|
|
37
37
|
toggleIsEdit,
|
|
38
38
|
isCheckout,
|
|
39
|
-
isAlsea
|
|
39
|
+
isAlsea,
|
|
40
|
+
allowDriverUpdateData
|
|
40
41
|
} = props;
|
|
41
42
|
|
|
42
43
|
const theme = useTheme();
|
|
@@ -66,9 +67,9 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
66
67
|
const rules: any = {
|
|
67
68
|
required: isRequiredField(field.code)
|
|
68
69
|
? t(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
`VALIDATION_ERROR_${field.code.toUpperCase()}_REQUIRED`,
|
|
71
|
+
`${field.name} is required`,
|
|
72
|
+
).replace('_attribute_', t(field.name, field.code))
|
|
72
73
|
: null,
|
|
73
74
|
};
|
|
74
75
|
if (field.code && field.code === 'email') {
|
|
@@ -261,90 +262,93 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
261
262
|
sortInputFields({ values: validationFields?.fields?.checkout })
|
|
262
263
|
.length > 0 && (
|
|
263
264
|
<UDWrapper>
|
|
264
|
-
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
{
|
|
275
|
-
|
|
265
|
+
{allowDriverUpdateData && (
|
|
266
|
+
<>
|
|
267
|
+
{sortInputFields({
|
|
268
|
+
values: validationFields.fields?.checkout,
|
|
269
|
+
}).map(
|
|
270
|
+
(field: any) =>
|
|
271
|
+
showField &&
|
|
272
|
+
showField(field.code) &&
|
|
273
|
+
!isAlsea
|
|
274
|
+
&& (
|
|
275
|
+
<React.Fragment key={field.id}>
|
|
276
|
+
<OText style={styles.label}>
|
|
277
|
+
{t(field?.code.toUpperCase(), field?.name)}
|
|
278
|
+
</OText>
|
|
276
279
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
.toLowerCase()
|
|
310
|
-
.replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''),
|
|
311
|
-
);
|
|
312
|
-
field.code !== 'email'
|
|
313
|
-
? handleChangeInput(val)
|
|
314
|
-
: handleChangeInput({
|
|
315
|
-
target: {
|
|
316
|
-
name: 'email',
|
|
317
|
-
value: val.target.value
|
|
280
|
+
<Controller
|
|
281
|
+
key={field.id}
|
|
282
|
+
control={control}
|
|
283
|
+
render={() => (
|
|
284
|
+
<OInput
|
|
285
|
+
name={field.code}
|
|
286
|
+
placeholder={t(
|
|
287
|
+
field.code.toUpperCase(),
|
|
288
|
+
field?.name,
|
|
289
|
+
)}
|
|
290
|
+
placeholderTextColor={theme.colors.arrowColor}
|
|
291
|
+
style={styles.inputStyle}
|
|
292
|
+
icon={
|
|
293
|
+
field.code === 'email'
|
|
294
|
+
? theme.images.general.email
|
|
295
|
+
: theme.images.general.user
|
|
296
|
+
}
|
|
297
|
+
autoCapitalize={
|
|
298
|
+
field.code === 'email' ? 'none' : 'sentences'
|
|
299
|
+
}
|
|
300
|
+
isDisabled={!isEdit}
|
|
301
|
+
value={
|
|
302
|
+
formState?.changes[field.code] ??
|
|
303
|
+
(user && user[field.code]) ??
|
|
304
|
+
''
|
|
305
|
+
}
|
|
306
|
+
onChange={(val: any) => {
|
|
307
|
+
field.code !== 'email'
|
|
308
|
+
? setValue(field.code, val.target.value)
|
|
309
|
+
: setValue(
|
|
310
|
+
field.code,
|
|
311
|
+
val.target.value
|
|
318
312
|
.toLowerCase()
|
|
319
|
-
.replace(
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
313
|
+
.replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''),
|
|
314
|
+
);
|
|
315
|
+
field.code !== 'email'
|
|
316
|
+
? handleChangeInput(val)
|
|
317
|
+
: handleChangeInput({
|
|
318
|
+
target: {
|
|
319
|
+
name: 'email',
|
|
320
|
+
value: val.target.value
|
|
321
|
+
.toLowerCase()
|
|
322
|
+
.replace(
|
|
323
|
+
/[&,()%";:ç?<>{}\\[\]\s]/g,
|
|
324
|
+
'',
|
|
325
|
+
),
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
}}
|
|
329
|
+
autoCorrect={field.code === 'email' && false}
|
|
330
|
+
type={
|
|
331
|
+
field.code === 'email'
|
|
332
|
+
? 'email-address'
|
|
333
|
+
: 'default'
|
|
334
|
+
}
|
|
335
|
+
returnKeyType="done"
|
|
336
|
+
autoCompleteType={
|
|
337
|
+
field.code === 'email' ? 'email' : 'off'
|
|
338
|
+
}
|
|
339
|
+
selectionColor={theme.colors.primary}
|
|
340
|
+
color={theme.colors.textGray}
|
|
341
|
+
/>
|
|
342
|
+
)}
|
|
343
|
+
name={field.code}
|
|
344
|
+
rules={getInputRules(field)}
|
|
345
|
+
defaultValue={user && user[field.code]}
|
|
338
346
|
/>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
/>
|
|
344
|
-
</React.Fragment>
|
|
345
|
-
),
|
|
347
|
+
</React.Fragment>
|
|
348
|
+
),
|
|
349
|
+
)}
|
|
350
|
+
</>
|
|
346
351
|
)}
|
|
347
|
-
|
|
348
352
|
<OText style={styles.label}>{t('PASSWORD', 'Password')}</OText>
|
|
349
353
|
|
|
350
354
|
<Controller
|
|
@@ -445,7 +449,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
445
449
|
</OText>
|
|
446
450
|
)}
|
|
447
451
|
|
|
448
|
-
{!!showInputPhoneNumber && !isAlsea && (
|
|
452
|
+
{!!showInputPhoneNumber && !isAlsea && allowDriverUpdateData && (
|
|
449
453
|
<WrapperPhone>
|
|
450
454
|
<PhoneInputNumber
|
|
451
455
|
data={phoneInputData}
|
|
@@ -487,28 +491,28 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
487
491
|
isEdit) ||
|
|
488
492
|
(watchPassword?.length > 0 && watchConfirmPassword?.length > 0) ||
|
|
489
493
|
formState?.loading) && (
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
494
|
+
<View style={{ flex: 1, marginLeft: 5 }}>
|
|
495
|
+
<OButton
|
|
496
|
+
text={
|
|
497
|
+
formState.loading
|
|
498
|
+
? t('UPDATING', 'Updating')
|
|
499
|
+
: t('UPDATE', 'Update')
|
|
500
|
+
}
|
|
501
|
+
bgColor={theme.colors.primary}
|
|
502
|
+
textStyle={{
|
|
503
|
+
...styles.btnText,
|
|
504
|
+
color: formState.loading
|
|
505
|
+
? theme.colors.textGray
|
|
506
|
+
: theme.colors.white,
|
|
507
|
+
}}
|
|
508
|
+
borderColor={theme.colors.primary}
|
|
509
|
+
isDisabled={formState.loading}
|
|
510
|
+
imgRightSrc={null}
|
|
511
|
+
style={styles.editButton}
|
|
512
|
+
onClick={handleSubmit(onSubmit)}
|
|
513
|
+
/>
|
|
514
|
+
</View>
|
|
515
|
+
)}
|
|
512
516
|
</EditButton>
|
|
513
517
|
)}
|
|
514
518
|
</>
|