ordering-ui-react-native 0.16.29 → 0.16.30-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 +8 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +15 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +2 -20
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +15 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +0 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +42 -34
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OModal.tsx +40 -37
- package/themes/business/src/types/index.tsx +15 -9
- package/themes/business/src/utils/index.tsx +10 -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 +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- 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/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +12 -0
- package/themes/original/src/components/AddressDetails/index.tsx +1 -1
- package/themes/original/src/components/AddressForm/index.tsx +139 -135
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +311 -161
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +190 -113
- package/themes/original/src/components/BusinessController/styles.tsx +0 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -4
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +80 -128
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +293 -177
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +23 -11
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -10
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +105 -519
- package/themes/original/src/components/Cart/index.tsx +44 -12
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +101 -61
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -0
- package/themes/original/src/components/FavoriteList/index.tsx +32 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -72
- package/themes/original/src/components/LoginForm/index.tsx +83 -45
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentOption/index.tsx +1 -1
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
- package/themes/original/src/components/MyOrders/index.tsx +70 -6
- package/themes/original/src/components/NavBar/index.tsx +15 -9
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +190 -35
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +8 -2
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +71 -55
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +633 -664
- package/themes/original/src/components/ProductForm/styles.tsx +9 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +5 -3
- package/themes/original/src/components/ServiceForm/index.tsx +637 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/SignupForm/index.tsx +350 -206
- package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
- package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
- package/themes/original/src/components/SingleProductCard/index.tsx +199 -110
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -10
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +15 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +31 -17
- package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
- package/themes/original/src/components/UserProfile/index.tsx +54 -29
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +121 -30
- package/themes/original/src/utils/index.tsx +77 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
+
import { StyleSheet, Platform, View, Dimensions } from 'react-native'
|
|
3
|
+
import { useUtils, useLanguage, useConfig } from 'ordering-components/native'
|
|
4
|
+
import { useTheme } from 'styled-components/native'
|
|
5
|
+
import CalendarPicker from 'react-native-calendar-picker'
|
|
6
|
+
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
7
|
+
import moment from 'moment'
|
|
8
|
+
import SelectDropdown from 'react-native-select-dropdown'
|
|
9
|
+
import { OButton, OText, OIcon } from '../shared'
|
|
10
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign'
|
|
11
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
12
|
+
import { ProfessionalProfileParams } from '../../types'
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
Container,
|
|
16
|
+
ProfessionalPhoto,
|
|
17
|
+
InfoWrapper,
|
|
18
|
+
Divider,
|
|
19
|
+
ScheduleWrapper,
|
|
20
|
+
ButtonWrapper,
|
|
21
|
+
CalendarWrapper
|
|
22
|
+
} from './styles'
|
|
23
|
+
|
|
24
|
+
const windowWidth = Dimensions.get('window').width
|
|
25
|
+
|
|
26
|
+
export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
|
|
27
|
+
const {
|
|
28
|
+
professional,
|
|
29
|
+
handleChangeProfessionalSelected,
|
|
30
|
+
onClose
|
|
31
|
+
} = props
|
|
32
|
+
|
|
33
|
+
const [{ optimizeImage }] = useUtils()
|
|
34
|
+
const theme = useTheme()
|
|
35
|
+
const [, t] = useLanguage()
|
|
36
|
+
const [{ configs }] = useConfig()
|
|
37
|
+
const { top } = useSafeAreaInsets()
|
|
38
|
+
|
|
39
|
+
const [selectDate, setSelectedDate] = useState<any>(new Date())
|
|
40
|
+
const [isEnabled, setIsEnabled] = useState(false)
|
|
41
|
+
const [timeList, setTimeList] = useState<any>([])
|
|
42
|
+
const dropdownRef = useRef<any>(null)
|
|
43
|
+
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
buttonStyle: {
|
|
46
|
+
borderRadius: 7.6,
|
|
47
|
+
height: 44,
|
|
48
|
+
borderWidth: 0
|
|
49
|
+
},
|
|
50
|
+
selectOption: {
|
|
51
|
+
width: '100%',
|
|
52
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
53
|
+
paddingVertical: 5,
|
|
54
|
+
paddingHorizontal: 14,
|
|
55
|
+
flexDirection: 'row-reverse',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
justifyContent: 'space-between',
|
|
58
|
+
height: 40,
|
|
59
|
+
marginBottom: 30
|
|
60
|
+
},
|
|
61
|
+
photoStyle: {
|
|
62
|
+
alignSelf: 'center'
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const onDateChange = (date: any) => {
|
|
67
|
+
setSelectedDate(date)
|
|
68
|
+
dropdownRef?.current && dropdownRef.current.reset()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const dropDownIcon = () => {
|
|
72
|
+
return (
|
|
73
|
+
<IconAntDesign
|
|
74
|
+
name='down'
|
|
75
|
+
color={theme.colors.textThird}
|
|
76
|
+
size={12}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const customDayHeaderStylesCallback = () => {
|
|
82
|
+
return {
|
|
83
|
+
textStyle: {
|
|
84
|
+
color: theme.colors.disabled,
|
|
85
|
+
fontSize: 12,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const validateSelectedDate = (curdate: any, menu: any) => {
|
|
91
|
+
const day = moment(curdate).format('d')
|
|
92
|
+
setIsEnabled(menu?.schedule?.[day]?.enabled || false)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const getTimes = (curdate: any, menu: any) => {
|
|
96
|
+
validateSelectedDate(curdate, menu)
|
|
97
|
+
const date = new Date()
|
|
98
|
+
var dateSeleted = new Date(curdate)
|
|
99
|
+
var times = []
|
|
100
|
+
for (var k = 0; k < menu.schedule[dateSeleted.getDay()].lapses.length; k++) {
|
|
101
|
+
var open = {
|
|
102
|
+
hour: menu.schedule[dateSeleted.getDay()].lapses[k].open.hour,
|
|
103
|
+
minute: menu.schedule[dateSeleted.getDay()].lapses[k].open.minute
|
|
104
|
+
}
|
|
105
|
+
var close = {
|
|
106
|
+
hour: menu.schedule[dateSeleted.getDay()].lapses[k].close.hour,
|
|
107
|
+
minute: menu.schedule[dateSeleted.getDay()].lapses[k].close.minute
|
|
108
|
+
}
|
|
109
|
+
for (var i = open.hour; i <= close.hour; i++) {
|
|
110
|
+
if (date.getDate() !== dateSeleted.getDate() || i >= date.getHours()) {
|
|
111
|
+
let hour = ''
|
|
112
|
+
let meridian = ''
|
|
113
|
+
if (configs?.format_time?.value === '12') {
|
|
114
|
+
if (i === 0) {
|
|
115
|
+
hour = '12'
|
|
116
|
+
meridian = ' ' + t('AM', 'AM')
|
|
117
|
+
} else if (i > 0 && i < 12) {
|
|
118
|
+
hour = (i < 10 ? '0' + i : i)
|
|
119
|
+
meridian = ' ' + t('AM', 'AM')
|
|
120
|
+
} else if (i === 12) {
|
|
121
|
+
hour = '12'
|
|
122
|
+
meridian = ' ' + t('PM', 'PM')
|
|
123
|
+
} else {
|
|
124
|
+
hour = ((i - 12 < 10) ? '0' + (i - 12) : `${(i - 12)}`)
|
|
125
|
+
meridian = ' ' + t('PM', 'PM')
|
|
126
|
+
}
|
|
127
|
+
} else {
|
|
128
|
+
hour = i < 10 ? '0' + i : i
|
|
129
|
+
}
|
|
130
|
+
for (let j = (i === open.hour ? open.minute : 0); j <= (i === close.hour ? close.minute : 59); j += 15) {
|
|
131
|
+
if (i !== date.getHours() || j >= date.getMinutes() || date.getDate() !== dateSeleted.getDate()) {
|
|
132
|
+
times.push({
|
|
133
|
+
text: hour + ':' + (j < 10 ? '0' + j : j) + meridian,
|
|
134
|
+
value: (i < 10 ? '0' + i : i) + ':' + (j < 10 ? '0' + j : j)
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return times
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const handleSelectProfessional = () => {
|
|
145
|
+
handleChangeProfessionalSelected(professional)
|
|
146
|
+
onClose && onClose()
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (selectDate === null) return
|
|
151
|
+
const _times = getTimes(selectDate, professional)
|
|
152
|
+
setTimeList(_times)
|
|
153
|
+
}, [selectDate, professional])
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<Container>
|
|
157
|
+
{!!professional?.photo ? (
|
|
158
|
+
<ProfessionalPhoto
|
|
159
|
+
source={{
|
|
160
|
+
uri: professional?.photo
|
|
161
|
+
}}
|
|
162
|
+
/>
|
|
163
|
+
) : (
|
|
164
|
+
<OIcon
|
|
165
|
+
src={theme.images.general.user}
|
|
166
|
+
style={styles.photoStyle}
|
|
167
|
+
cover={false}
|
|
168
|
+
width={200}
|
|
169
|
+
height={200}
|
|
170
|
+
/>
|
|
171
|
+
)}
|
|
172
|
+
<InfoWrapper>
|
|
173
|
+
<OText
|
|
174
|
+
size={20}
|
|
175
|
+
style={{ marginBottom: 3 }}
|
|
176
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
177
|
+
>
|
|
178
|
+
{professional?.name} {professional?.lastname}
|
|
179
|
+
</OText>
|
|
180
|
+
</InfoWrapper>
|
|
181
|
+
<Divider />
|
|
182
|
+
<ScheduleWrapper>
|
|
183
|
+
<View
|
|
184
|
+
style={{
|
|
185
|
+
flexDirection: 'row',
|
|
186
|
+
justifyContent: 'space-between',
|
|
187
|
+
alignItems: 'center',
|
|
188
|
+
marginBottom: 23
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<OText
|
|
192
|
+
size={16}
|
|
193
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
194
|
+
>
|
|
195
|
+
{t('SCHEDULE', 'Schedule')}
|
|
196
|
+
</OText>
|
|
197
|
+
<OText
|
|
198
|
+
size={10}
|
|
199
|
+
weight={'400'}
|
|
200
|
+
color={theme.colors?.danger5}
|
|
201
|
+
>
|
|
202
|
+
{t('REQUIRED', 'Required')}
|
|
203
|
+
</OText>
|
|
204
|
+
</View>
|
|
205
|
+
{!!professional?.schedule ? (
|
|
206
|
+
<CalendarWrapper>
|
|
207
|
+
{(timeList?.length > 0 && isEnabled) ? (
|
|
208
|
+
<SelectDropdown
|
|
209
|
+
ref={dropdownRef}
|
|
210
|
+
data={timeList}
|
|
211
|
+
onSelect={(selectedItem, index) => {
|
|
212
|
+
console.log(selectedItem.value)
|
|
213
|
+
}}
|
|
214
|
+
buttonTextAfterSelection={(selectedItem, index) => {
|
|
215
|
+
return selectedItem.text
|
|
216
|
+
}}
|
|
217
|
+
rowTextForSelection={(item, index) => {
|
|
218
|
+
return item.text
|
|
219
|
+
}}
|
|
220
|
+
buttonStyle={{borderRadius: 7.6, ...styles.selectOption}}
|
|
221
|
+
buttonTextStyle={{
|
|
222
|
+
color: theme.colors.disabled,
|
|
223
|
+
fontSize: 14,
|
|
224
|
+
textAlign: 'left',
|
|
225
|
+
marginHorizontal: 0
|
|
226
|
+
}}
|
|
227
|
+
dropdownStyle={{
|
|
228
|
+
borderRadius: 8,
|
|
229
|
+
borderColor: theme.colors.lightGray,
|
|
230
|
+
marginTop: Platform.OS === 'ios' ? 12 : -top
|
|
231
|
+
}}
|
|
232
|
+
rowStyle={{
|
|
233
|
+
borderBottomColor: theme.colors.backgroundGray100,
|
|
234
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
235
|
+
height: 30,
|
|
236
|
+
flexDirection: 'column',
|
|
237
|
+
alignItems: 'flex-start',
|
|
238
|
+
paddingTop: 8,
|
|
239
|
+
paddingHorizontal: 12
|
|
240
|
+
}}
|
|
241
|
+
rowTextStyle={{
|
|
242
|
+
color: theme.colors.disabled,
|
|
243
|
+
fontSize: 14,
|
|
244
|
+
marginHorizontal: 0
|
|
245
|
+
}}
|
|
246
|
+
renderDropdownIcon={() => dropDownIcon()}
|
|
247
|
+
dropdownOverlayColor='transparent'
|
|
248
|
+
/>
|
|
249
|
+
) : (
|
|
250
|
+
<OText
|
|
251
|
+
size={12}
|
|
252
|
+
style={{ marginBottom: 30 }}
|
|
253
|
+
weight={'400'}
|
|
254
|
+
color={theme.colors?.danger5}
|
|
255
|
+
>
|
|
256
|
+
{t('PROFESSIONAL_NOT_AVAILABLE', 'Professional is not available at the moment')}
|
|
257
|
+
</OText>
|
|
258
|
+
)}
|
|
259
|
+
|
|
260
|
+
<CalendarPicker
|
|
261
|
+
previousComponent={
|
|
262
|
+
<FeatherIcon
|
|
263
|
+
name='chevron-left'
|
|
264
|
+
color={theme.colors.disabled}
|
|
265
|
+
size={24}
|
|
266
|
+
style={{ marginHorizontal: 4 }}
|
|
267
|
+
/>
|
|
268
|
+
}
|
|
269
|
+
nextComponent={
|
|
270
|
+
<FeatherIcon
|
|
271
|
+
name='chevron-right'
|
|
272
|
+
color={theme.colors.disabled}
|
|
273
|
+
size={24}
|
|
274
|
+
style={{ marginHorizontal: 4 }}
|
|
275
|
+
/>
|
|
276
|
+
}
|
|
277
|
+
width={windowWidth - 110}
|
|
278
|
+
selectedDayTextColor={theme.colors.white}
|
|
279
|
+
selectedDayColor={theme.colors.primary}
|
|
280
|
+
todayBackgroundColor={theme.colors.border}
|
|
281
|
+
dayLabelsWrapper={{ borderColor: theme.colors.clear }}
|
|
282
|
+
onDateChange={onDateChange}
|
|
283
|
+
minDate={new Date()}
|
|
284
|
+
customDayHeaderStyles={customDayHeaderStylesCallback}
|
|
285
|
+
selectedStartDate={selectDate}
|
|
286
|
+
/>
|
|
287
|
+
</CalendarWrapper>
|
|
288
|
+
) : (
|
|
289
|
+
<OText
|
|
290
|
+
size={20}
|
|
291
|
+
style={{ marginBottom: 30 }}
|
|
292
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
293
|
+
>
|
|
294
|
+
{t('NO_SCHEDULE', 'No schedule')}
|
|
295
|
+
</OText>
|
|
296
|
+
)}
|
|
297
|
+
</ScheduleWrapper>
|
|
298
|
+
<ButtonWrapper>
|
|
299
|
+
<OButton
|
|
300
|
+
bgColor={theme.colors.primary}
|
|
301
|
+
onClick={() => handleSelectProfessional()}
|
|
302
|
+
text={t('BOOK', 'Book')}
|
|
303
|
+
style={styles.buttonStyle}
|
|
304
|
+
textStyle={{ fontSize: 14, color: theme.colors.white }}
|
|
305
|
+
/>
|
|
306
|
+
</ButtonWrapper>
|
|
307
|
+
</Container>
|
|
308
|
+
)
|
|
309
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.ScrollView``
|
|
4
|
+
|
|
5
|
+
export const ProfessionalPhoto = styled.ImageBackground`
|
|
6
|
+
width: 100%;
|
|
7
|
+
position: relative;
|
|
8
|
+
max-height: 258px;
|
|
9
|
+
height: 258px;
|
|
10
|
+
resize-mode: cover;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const InfoWrapper = styled.View`
|
|
14
|
+
margin-vertical: 30px;
|
|
15
|
+
padding-horizontal: 40px;
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
export const Divider = styled.View`
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 8px;
|
|
21
|
+
background-color: ${(props: any) => props.theme.colors.backgroundGray100};
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
export const ScheduleWrapper = styled.View`
|
|
25
|
+
padding-horizontal: 40px;
|
|
26
|
+
margin-top: 30px;
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
export const ButtonWrapper = styled.View`
|
|
30
|
+
justify-content: center;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
padding-vertical: 13px;
|
|
33
|
+
margin-top: 30px;
|
|
34
|
+
margin-bottom: 40px;
|
|
35
|
+
width: 100%;
|
|
36
|
+
border-top-width: 1px;
|
|
37
|
+
border-top-color: ${(props: any) => props.theme.colors.backgroundGray200};
|
|
38
|
+
`
|
|
39
|
+
|
|
40
|
+
export const CalendarWrapper = styled.View`
|
|
41
|
+
flex: 1;
|
|
42
|
+
border-width: 1px;
|
|
43
|
+
border-color: ${(props: any) => props.theme.colors.backgroundGray200};
|
|
44
|
+
border-radius: 7.6px;
|
|
45
|
+
padding: 15px;
|
|
46
|
+
`
|
|
@@ -44,7 +44,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
44
44
|
photoWrapper: {
|
|
45
45
|
shadowColor: theme.colors.black,
|
|
46
46
|
shadowRadius: 3,
|
|
47
|
-
shadowOffset: {width: 1, height: 4},
|
|
47
|
+
shadowOffset: { width: 1, height: 4 },
|
|
48
48
|
elevation: 3,
|
|
49
49
|
borderRadius: 8,
|
|
50
50
|
shadowOpacity: 0.1,
|
|
@@ -86,11 +86,11 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
86
86
|
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
87
87
|
|
|
88
88
|
const qualificationList = [
|
|
89
|
-
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0,
|
|
89
|
+
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
|
|
90
90
|
{ key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
|
|
91
91
|
{ key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
|
|
92
92
|
{ key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
|
|
93
|
-
{ key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false,
|
|
93
|
+
{ key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
|
|
94
94
|
]
|
|
95
95
|
|
|
96
96
|
const commentsList = reviewCommentList('driver')
|
|
@@ -204,7 +204,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
204
204
|
<OIcon
|
|
205
205
|
url={order?.driver?.photo}
|
|
206
206
|
src={!order?.driver?.photo && theme.images.general.user}
|
|
207
|
-
cover={order?.driver?.photo ? true: false}
|
|
207
|
+
cover={order?.driver?.photo ? true : false}
|
|
208
208
|
width={80}
|
|
209
209
|
height={80}
|
|
210
210
|
/>
|
|
@@ -212,7 +212,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
212
212
|
<OText weight={500} style={{ marginVertical: 10 }} color={theme.colors.textNormal}>{order?.driver?.name} {order?.driver?.lastname}</OText>
|
|
213
213
|
</DriverPhotoContainer>
|
|
214
214
|
|
|
215
|
-
<View style={{flex: 1, justifyContent: 'flex-end'}}>
|
|
215
|
+
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
216
216
|
<FormReviews>
|
|
217
217
|
<OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_DRIVER', 'How was your driver?')}</OText>
|
|
218
218
|
<RatingBarContainer>
|
|
@@ -264,7 +264,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
264
264
|
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
265
265
|
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
266
266
|
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
267
|
-
onClick={() => handleChangeComment(commentItem)
|
|
267
|
+
onClick={() => handleChangeComment(commentItem)}
|
|
268
268
|
/>
|
|
269
269
|
))}
|
|
270
270
|
</CommentsButtonGroup>
|
|
@@ -92,6 +92,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
92
92
|
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
93
93
|
const [comments, setComments] = useState<Array<any>>([])
|
|
94
94
|
const [extraComment, setExtraComment] = useState('')
|
|
95
|
+
const [enableProduct, setEnableProduct] = useState(true)
|
|
95
96
|
|
|
96
97
|
const onSubmit = () => {
|
|
97
98
|
if (Object.values(stars).some((value: any) => value === 0)) {
|
|
@@ -105,6 +106,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
105
106
|
handleReviewState && handleReviewState(order?.id)
|
|
106
107
|
setIsReviewed && setIsReviewed(true)
|
|
107
108
|
setAlertState({ ...alertState, success: true })
|
|
109
|
+
!enableProduct && navigation?.canGoBack() && navigation.goBack()
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
const qualificationList = [
|
|
@@ -141,7 +143,16 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
141
143
|
if (!order?.review) {
|
|
142
144
|
onSubmit()
|
|
143
145
|
} else {
|
|
144
|
-
|
|
146
|
+
skipOrderReview()
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const skipOrderReview = () => {
|
|
151
|
+
if (enableProduct) onNavigationRedirect('ReviewProducts', { order: order })
|
|
152
|
+
else if (order?.driver && !order?.user_review) {
|
|
153
|
+
onNavigationRedirect('ReviewDriver', { order: order })
|
|
154
|
+
} else {
|
|
155
|
+
navigation?.canGoBack() && navigation.goBack()
|
|
145
156
|
}
|
|
146
157
|
}
|
|
147
158
|
|
|
@@ -187,6 +198,10 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
187
198
|
setStars({ ...stars, comments: _comment })
|
|
188
199
|
}, [comments, extraComment])
|
|
189
200
|
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
setEnableProduct(!order?.products.every(product => product?.deleted))
|
|
203
|
+
}, [order])
|
|
204
|
+
|
|
190
205
|
return (
|
|
191
206
|
<>
|
|
192
207
|
<ReviewOrderContainer>
|
|
@@ -296,7 +311,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
296
311
|
<FloatingBottomContainer>
|
|
297
312
|
<ActionContainer>
|
|
298
313
|
<SkipButton
|
|
299
|
-
onPress={() =>
|
|
314
|
+
onPress={() => skipOrderReview()}
|
|
300
315
|
>
|
|
301
316
|
<OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
|
|
302
317
|
</SkipButton>
|
|
@@ -318,7 +333,7 @@ export const ReviewOrder = (props: ReviewOrderParams) => {
|
|
|
318
333
|
const reviewOrderProps = {
|
|
319
334
|
...props,
|
|
320
335
|
UIComponent: ReviewOrderUI,
|
|
321
|
-
defaultStar: 5
|
|
336
|
+
defaultStar: props?.defaultStar || 5
|
|
322
337
|
}
|
|
323
338
|
return <ReviewOrderController {...reviewOrderProps} />
|
|
324
339
|
}
|
|
@@ -74,7 +74,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
74
74
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
75
75
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
76
76
|
/>
|
|
77
|
-
{order?.products?.map((product: any) => (
|
|
77
|
+
{order?.products?.map((product: any) => !product?.deleted && (
|
|
78
78
|
<SingleProductReview
|
|
79
79
|
key={product.id}
|
|
80
80
|
product={product}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
3
|
+
import { useLanguage, useUtils } from 'ordering-components/native'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ReviewOrderContainer,
|
|
7
|
+
BusinessLogo,
|
|
8
|
+
FormReviews,
|
|
9
|
+
ActionContainer,
|
|
10
|
+
RatingStarContainer,
|
|
11
|
+
PlacedDate
|
|
12
|
+
} from './styles'
|
|
13
|
+
import { OButton, OIcon, OText } from '../shared'
|
|
14
|
+
import { StyleSheet, View, I18nManager } from 'react-native';
|
|
15
|
+
import { FloatingBottomContainer } from '../../layouts/FloatingBottomContainer'
|
|
16
|
+
|
|
17
|
+
import { useTheme } from 'styled-components/native'
|
|
18
|
+
|
|
19
|
+
export const ReviewTrigger = (props: any) => {
|
|
20
|
+
const {
|
|
21
|
+
order,
|
|
22
|
+
handleOpenOrderReview
|
|
23
|
+
} = props
|
|
24
|
+
|
|
25
|
+
const theme = useTheme()
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
logoWrapper: {
|
|
29
|
+
shadowColor: theme.colors.black,
|
|
30
|
+
shadowRadius: 3,
|
|
31
|
+
shadowOffset: { width: 1, height: 4 },
|
|
32
|
+
elevation: 3,
|
|
33
|
+
borderRadius: 8,
|
|
34
|
+
shadowOpacity: 0.1,
|
|
35
|
+
overflow: 'hidden'
|
|
36
|
+
},
|
|
37
|
+
inputTextArea: {
|
|
38
|
+
borderColor: theme.colors.lightGray,
|
|
39
|
+
borderRadius: 8,
|
|
40
|
+
marginTop: 10,
|
|
41
|
+
marginBottom: 40,
|
|
42
|
+
height: 100,
|
|
43
|
+
alignItems: 'flex-start'
|
|
44
|
+
},
|
|
45
|
+
statusBar: {
|
|
46
|
+
transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
|
|
47
|
+
height: 10,
|
|
48
|
+
borderRadius: 5,
|
|
49
|
+
marginTop: 5
|
|
50
|
+
},
|
|
51
|
+
ratingItemContainer: {
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
top: -20
|
|
54
|
+
},
|
|
55
|
+
ratingItem: {
|
|
56
|
+
left: '-50%',
|
|
57
|
+
flexDirection: 'column',
|
|
58
|
+
alignItems: 'center'
|
|
59
|
+
},
|
|
60
|
+
ratingLineStyle: {
|
|
61
|
+
height: 10,
|
|
62
|
+
width: 1,
|
|
63
|
+
marginBottom: 10,
|
|
64
|
+
backgroundColor: theme.colors.dusk
|
|
65
|
+
},
|
|
66
|
+
reviewedStyle: {
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
marginVertical: 20
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const [, t] = useLanguage()
|
|
74
|
+
const [{ parseDate }] = useUtils()
|
|
75
|
+
const placedOnDate = parseDate(order?.delivery_datetime, { utc: true, outputFormat: 'dddd MMMM DD, YYYY' })
|
|
76
|
+
const [star, setStar] = useState(5)
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<ReviewOrderContainer>
|
|
81
|
+
<BusinessLogo>
|
|
82
|
+
<View style={styles.logoWrapper}>
|
|
83
|
+
<OIcon
|
|
84
|
+
url={order?.logo}
|
|
85
|
+
width={80}
|
|
86
|
+
height={80}
|
|
87
|
+
/>
|
|
88
|
+
</View>
|
|
89
|
+
</BusinessLogo>
|
|
90
|
+
{!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
|
|
91
|
+
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
92
|
+
<FormReviews>
|
|
93
|
+
<RatingStarContainer>
|
|
94
|
+
{[...Array(5).keys()].map((index: number) => (<FontAwesome name={(index <= (star - 1)) ? 'star' : 'star-o'} size={28} key={`star-symbol-${index}`} onPress={() => setStar(index + 1)} color={theme?.colors?.primary} />)
|
|
95
|
+
)}
|
|
96
|
+
</RatingStarContainer>
|
|
97
|
+
<PlacedDate>
|
|
98
|
+
<OText color={theme.colors.textNormal}>{t('DONOT_FORGET_RATE_YOUR_ORDER', 'Do not forget to rate your order placed on ')}</OText>
|
|
99
|
+
<OText color={theme.colors.textNormal} style={{ fontWeight: "bold" }}>{placedOnDate}</OText>
|
|
100
|
+
</PlacedDate>
|
|
101
|
+
</FormReviews>
|
|
102
|
+
</View>
|
|
103
|
+
</ReviewOrderContainer>
|
|
104
|
+
<FloatingBottomContainer borderTopWidth={0} borderRadius={10}>
|
|
105
|
+
<ActionContainer>
|
|
106
|
+
<OButton
|
|
107
|
+
textStyle={{ color: theme.colors.white, paddingRight: 10 }}
|
|
108
|
+
text={t('GOTO_REVIEW', 'Go to review')}
|
|
109
|
+
style={{ borderRadius: 8 }}
|
|
110
|
+
imgRightSrc={theme.images.general.arrow_right}
|
|
111
|
+
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
112
|
+
onClick={() => handleOpenOrderReview(star)}
|
|
113
|
+
/>
|
|
114
|
+
</ActionContainer>
|
|
115
|
+
</FloatingBottomContainer>
|
|
116
|
+
</>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const ReviewOrderContainer = styled.ScrollView`
|
|
4
|
+
padding: 0 25px;
|
|
5
|
+
margin-bottom: 100px;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const BusinessLogo = styled.View`
|
|
9
|
+
margin-vertical: 5px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const FormReviews = styled.View`
|
|
14
|
+
flex: 1;
|
|
15
|
+
height: 100%;
|
|
16
|
+
margin-top: 10px;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
export const ActionContainer = styled.View`
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
padding: 3px 30px;
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
export const RatingStarContainer = styled.View`
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
margin-top: 10px;
|
|
31
|
+
`
|
|
32
|
+
export const PlacedDate = styled.View`
|
|
33
|
+
margin-top: 30px;
|
|
34
|
+
`
|
|
@@ -25,7 +25,8 @@ export const SearchBar = (props: any) => {
|
|
|
25
25
|
blurOnSubmit,
|
|
26
26
|
inputContainerStyles,
|
|
27
27
|
containerStyles,
|
|
28
|
-
hideIcon
|
|
28
|
+
hideIcon,
|
|
29
|
+
autoFocus
|
|
29
30
|
} = props
|
|
30
31
|
|
|
31
32
|
const theme = useTheme();
|
|
@@ -82,15 +83,16 @@ export const SearchBar = (props: any) => {
|
|
|
82
83
|
return (
|
|
83
84
|
<Pressable style={[styles.container, containerStyles, { height: height }]}>
|
|
84
85
|
<OInput
|
|
86
|
+
autoFocus={autoFocus}
|
|
85
87
|
value={searchValue}
|
|
86
88
|
onChange={onChangeSearch}
|
|
87
|
-
style={{...styles.inputStyle, ...inputContainerStyles}}
|
|
89
|
+
style={{ ...styles.inputStyle, ...inputContainerStyles }}
|
|
88
90
|
placeholder={placeholder}
|
|
89
91
|
icon={!hideIcon && theme.images.general.search}
|
|
90
92
|
isDisabled={isDisabled}
|
|
91
93
|
iconStyle={{ width: 12 }}
|
|
92
94
|
returnKeyType='done'
|
|
93
|
-
inputStyle={{padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle}}
|
|
95
|
+
inputStyle={{ padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle }}
|
|
94
96
|
onPress={() => onPress && onPress()}
|
|
95
97
|
iconCustomRight={iconCustomRight}
|
|
96
98
|
onSubmitEditing={() => onSubmitEditing && onSubmitEditing()}
|