ordering-ui-react-native 0.16.90 → 0.16.92
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/BusinessController/index.tsx +1 -0
- package/themes/business/src/components/Chat/index.tsx +1 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/OrdersOption/index.tsx +50 -16
- 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 +1 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +13 -3
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/types/index.tsx +2 -1
- package/themes/original/src/components/AddressForm/index.tsx +20 -29
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +20 -19
- package/themes/original/src/components/BusinessListingSearch/index.tsx +34 -9
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
- package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +25 -15
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/OrderTypeSelector/index.tsx +6 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +17 -2
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
package/package.json
CHANGED
|
@@ -97,6 +97,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
97
97
|
<Logo style={styles.logo}>
|
|
98
98
|
<OIcon
|
|
99
99
|
url={optimizeImage(business?.logo, 'h_300,c_limit')}
|
|
100
|
+
src={!business?.logo && theme?.images?.dummies?.businessLogo}
|
|
100
101
|
style={styles.icon}
|
|
101
102
|
/>
|
|
102
103
|
</Logo>
|
|
@@ -742,7 +742,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
742
742
|
color: '#414954'
|
|
743
743
|
}}
|
|
744
744
|
style={{ ...styles.editButton }}
|
|
745
|
-
onClick={() => handleClickQuickMessage(quickMessage.text)}
|
|
745
|
+
onClick={() => handleClickQuickMessage(message?.length > 0 ? ' ' + quickMessage.text : quickMessage.text)}
|
|
746
746
|
/>
|
|
747
747
|
</React.Fragment>
|
|
748
748
|
))}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
StyleSheet,
|
|
6
6
|
Dimensions,
|
|
7
7
|
ScrollView,
|
|
8
|
+
RefreshControl,
|
|
8
9
|
} from 'react-native';
|
|
9
10
|
import { Contacts, useLanguage } from 'ordering-components/native';
|
|
10
11
|
import { useTheme } from 'styled-components/native';
|
|
@@ -24,6 +25,7 @@ const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
|
24
25
|
messages,
|
|
25
26
|
onNavigationRedirect,
|
|
26
27
|
setSortBy,
|
|
28
|
+
getOrders
|
|
27
29
|
} = props;
|
|
28
30
|
|
|
29
31
|
const theme = useTheme();
|
|
@@ -55,6 +57,7 @@ const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
|
55
57
|
const [tabsFilter, setTabsFilter] = useState(tabs[0].tags);
|
|
56
58
|
const [activeTag, setActiveTag] = useState(tags[0].key);
|
|
57
59
|
const [reload, setReload] = useState(false);
|
|
60
|
+
const [refreshing] = useState(false);
|
|
58
61
|
const [unreadMessages, setUnreadMessages] = useState(
|
|
59
62
|
values?.reduce(
|
|
60
63
|
(total: number, order: any) => total + order.unread_count,
|
|
@@ -247,7 +250,14 @@ const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
|
247
250
|
/>
|
|
248
251
|
)}
|
|
249
252
|
|
|
250
|
-
<ScrollView
|
|
253
|
+
<ScrollView
|
|
254
|
+
showsVerticalScrollIndicator={false}
|
|
255
|
+
style={{ flex: 1 }}
|
|
256
|
+
refreshControl={<RefreshControl
|
|
257
|
+
refreshing={refreshing}
|
|
258
|
+
onRefresh={() => getOrders?.()}
|
|
259
|
+
/>}
|
|
260
|
+
>
|
|
251
261
|
{!reload &&
|
|
252
262
|
!error &&
|
|
253
263
|
values.length > 0 &&
|
|
@@ -5,6 +5,7 @@ import SelectDropdown from 'react-native-select-dropdown'
|
|
|
5
5
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
6
6
|
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
7
7
|
import FontistoIcon from 'react-native-vector-icons/Fontisto'
|
|
8
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
8
9
|
import { useTheme } from 'styled-components/native';
|
|
9
10
|
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
10
11
|
import { NotificationSetting } from '../../../../../src/components/NotificationSetting'
|
|
@@ -33,7 +34,8 @@ import {
|
|
|
33
34
|
ItemContent,
|
|
34
35
|
TimerInputWrapper,
|
|
35
36
|
OverLine,
|
|
36
|
-
Actions
|
|
37
|
+
Actions,
|
|
38
|
+
InputContainer
|
|
37
39
|
} from './styles';
|
|
38
40
|
import { PreviousOrders } from '../PreviousOrders';
|
|
39
41
|
import { OrdersOptionParams } from '../../types';
|
|
@@ -48,7 +50,7 @@ import { OrdersOptionDelivery } from '../OrdersOptionDelivery';
|
|
|
48
50
|
import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
|
|
49
51
|
import { OrdersOptionDriver } from '../OrdersOptionDriver';
|
|
50
52
|
import { OrdersOptionDate } from '../OrdersOptionDate';
|
|
51
|
-
|
|
53
|
+
import { GestureEvent, GestureDetector } from 'react-native-gesture-handler'
|
|
52
54
|
const tabsList: any = {
|
|
53
55
|
pending: 1,
|
|
54
56
|
inProgress: 2,
|
|
@@ -123,7 +125,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
123
125
|
const [selectedTabStatus, setSelectedTabStatus] = useState([])
|
|
124
126
|
const [hour, setHour] = useState(0)
|
|
125
127
|
const [minute, setMinute] = useState(0)
|
|
126
|
-
|
|
128
|
+
const [openedSelect, setOpenedSelect] = useState('')
|
|
127
129
|
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
128
130
|
const HEIGHT_SCREEN = orientationState?.dimensions?.height
|
|
129
131
|
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
@@ -403,10 +405,11 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
403
405
|
setOpenSLASettingModal(false)
|
|
404
406
|
}
|
|
405
407
|
|
|
406
|
-
|
|
407
|
-
setCurrentFilters(null)
|
|
408
|
-
onFiltered && onFiltered(null)
|
|
408
|
+
const handleClearFilters = () => {
|
|
409
409
|
setSearch(defaultSearchList)
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
useEffect(() => {
|
|
410
413
|
scrollRefTab.current?.scrollTo({ animated: true });
|
|
411
414
|
scrollListRef.current?.scrollTo({ animated: true });
|
|
412
415
|
scrollRef.current?.scrollTo({ y: 0, animated: true });
|
|
@@ -415,7 +418,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
415
418
|
useEffect(() => {
|
|
416
419
|
setSelectedTabStatus(deliveryStatus)
|
|
417
420
|
}, [])
|
|
418
|
-
|
|
421
|
+
|
|
419
422
|
return (
|
|
420
423
|
// <GestureRecognizer
|
|
421
424
|
// onSwipeLeft={onSwipeLeft}
|
|
@@ -754,22 +757,34 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
754
757
|
{openSearchModal && (
|
|
755
758
|
<SearchModalContent>
|
|
756
759
|
<ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
|
|
757
|
-
<
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
760
|
+
<InputContainer>
|
|
761
|
+
<OInput
|
|
762
|
+
value={search.id}
|
|
763
|
+
onChange={(value: any) => setSearch({ ...search, id: value })}
|
|
764
|
+
style={styles.inputStyle}
|
|
765
|
+
placeholder={t('ORDER_NUMBER', 'Order number')}
|
|
766
|
+
autoCorrect={false}
|
|
767
|
+
/>
|
|
768
|
+
<AntDesignIcon
|
|
769
|
+
name='close'
|
|
770
|
+
size={20}
|
|
771
|
+
style={{ position: 'absolute', right: 12, top: 13 }}
|
|
772
|
+
onPress={() => setSearch({ ...search, id: '' })}
|
|
773
|
+
/>
|
|
774
|
+
</InputContainer>
|
|
764
775
|
<OrdersOptionDate
|
|
765
776
|
{...props}
|
|
766
777
|
search={search}
|
|
767
778
|
onSearch={setSearch}
|
|
779
|
+
setOpenedSelect={setOpenedSelect}
|
|
780
|
+
openedSelect={openedSelect}
|
|
768
781
|
/>
|
|
769
782
|
<OrdersOptionCity
|
|
770
783
|
{...props}
|
|
771
784
|
search={search}
|
|
772
785
|
onSearch={setSearch}
|
|
786
|
+
setOpenedSelect={setOpenedSelect}
|
|
787
|
+
openedSelect={openedSelect}
|
|
773
788
|
/>
|
|
774
789
|
{isBusinessApp && (
|
|
775
790
|
<>
|
|
@@ -777,21 +792,29 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
777
792
|
{...props}
|
|
778
793
|
search={search}
|
|
779
794
|
onSearch={setSearch}
|
|
795
|
+
setOpenedSelect={setOpenedSelect}
|
|
796
|
+
openedSelect={openedSelect}
|
|
780
797
|
/>
|
|
781
798
|
<OrdersOptionDelivery
|
|
782
799
|
{...props}
|
|
783
800
|
search={search}
|
|
784
801
|
onSearch={setSearch}
|
|
802
|
+
setOpenedSelect={setOpenedSelect}
|
|
803
|
+
openedSelect={openedSelect}
|
|
785
804
|
/>
|
|
786
805
|
<OrdersOptionDriver
|
|
787
806
|
{...props}
|
|
788
807
|
search={search}
|
|
789
808
|
onSearch={setSearch}
|
|
809
|
+
setOpenedSelect={setOpenedSelect}
|
|
810
|
+
openedSelect={openedSelect}
|
|
790
811
|
/>
|
|
791
812
|
<OrdersOptionPaymethod
|
|
792
813
|
{...props}
|
|
793
814
|
search={search}
|
|
794
815
|
onSearch={setSearch}
|
|
816
|
+
setOpenedSelect={setOpenedSelect}
|
|
817
|
+
openedSelect={openedSelect}
|
|
795
818
|
/>
|
|
796
819
|
</>
|
|
797
820
|
)}
|
|
@@ -801,13 +824,24 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
801
824
|
imgRightSrc={null}
|
|
802
825
|
style={{
|
|
803
826
|
borderRadius: 7.6,
|
|
804
|
-
marginBottom:
|
|
827
|
+
marginBottom: 10,
|
|
805
828
|
marginTop: 60,
|
|
806
829
|
zIndex: 12
|
|
807
830
|
}}
|
|
808
831
|
onClick={applyFilters}
|
|
809
832
|
/>
|
|
810
|
-
|
|
833
|
+
<OButton
|
|
834
|
+
text={t('CLEAR_SEARCh', 'Clear search')}
|
|
835
|
+
imgRightSrc={null}
|
|
836
|
+
bgColor='#fff'
|
|
837
|
+
style={{
|
|
838
|
+
borderRadius: 7.6,
|
|
839
|
+
marginBottom: 0,
|
|
840
|
+
marginTop: 0,
|
|
841
|
+
zIndex: 12
|
|
842
|
+
}}
|
|
843
|
+
onClick={handleClearFilters}
|
|
844
|
+
/>
|
|
811
845
|
</SearchModalContent>
|
|
812
846
|
)}
|
|
813
847
|
{openSLASettingModal && (
|
|
@@ -10,7 +10,9 @@ export const OrdersOptionBusinessUI = (props: any) => {
|
|
|
10
10
|
const {
|
|
11
11
|
search,
|
|
12
12
|
onSearch,
|
|
13
|
-
businessesList
|
|
13
|
+
businessesList,
|
|
14
|
+
setOpenedSelect,
|
|
15
|
+
openedSelect
|
|
14
16
|
} = props
|
|
15
17
|
|
|
16
18
|
const theme = useTheme();
|
|
@@ -25,6 +27,14 @@ export const OrdersOptionBusinessUI = (props: any) => {
|
|
|
25
27
|
setOptionsList(businesses)
|
|
26
28
|
}, [businessesList?.businesses])
|
|
27
29
|
|
|
30
|
+
const handleClear = () => {
|
|
31
|
+
onSearch({ ...search, option: '' })
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const handleOpenSelect = () => {
|
|
35
|
+
setOpenedSelect('business')
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
return (
|
|
29
39
|
<Container isIos={Platform.OS === 'ios'}>
|
|
30
40
|
<ODropDown
|
|
@@ -36,6 +46,10 @@ export const OrdersOptionBusinessUI = (props: any) => {
|
|
|
36
46
|
textcolor={theme.colors.unselectText}
|
|
37
47
|
placeholder={t('SELECT_BUSINESS', 'Select Business')}
|
|
38
48
|
dropViewMaxHeight={200}
|
|
49
|
+
handleClear={handleClear}
|
|
50
|
+
handleOpenSelect={handleOpenSelect}
|
|
51
|
+
openedSelect={openedSelect}
|
|
52
|
+
selectType='business'
|
|
39
53
|
/>
|
|
40
54
|
</Container>
|
|
41
55
|
);
|
|
@@ -10,7 +10,9 @@ export const OrdersOptionCityUI = (props: any) => {
|
|
|
10
10
|
const {
|
|
11
11
|
search,
|
|
12
12
|
onSearch,
|
|
13
|
-
allListValues
|
|
13
|
+
allListValues,
|
|
14
|
+
setOpenedSelect,
|
|
15
|
+
openedSelect
|
|
14
16
|
} = props
|
|
15
17
|
|
|
16
18
|
const theme = useTheme();
|
|
@@ -27,6 +29,14 @@ export const OrdersOptionCityUI = (props: any) => {
|
|
|
27
29
|
setOptionsList(cities)
|
|
28
30
|
}, [allListValues?.countries])
|
|
29
31
|
|
|
32
|
+
const handleClear = () => {
|
|
33
|
+
onSearch({ ...search, city: '' })
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const handleOpenSelect = () => {
|
|
37
|
+
setOpenedSelect('city')
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
return (
|
|
31
41
|
<Container isIos={Platform.OS === 'ios'}>
|
|
32
42
|
<ODropDown
|
|
@@ -38,6 +48,10 @@ export const OrdersOptionCityUI = (props: any) => {
|
|
|
38
48
|
textcolor={theme.colors.unselectText}
|
|
39
49
|
placeholder={t('SELECT_CITY', 'Select City')}
|
|
40
50
|
dropViewMaxHeight={200}
|
|
51
|
+
handleClear={handleClear}
|
|
52
|
+
handleOpenSelect={handleOpenSelect}
|
|
53
|
+
openedSelect={openedSelect}
|
|
54
|
+
selectType='city'
|
|
41
55
|
/>
|
|
42
56
|
</Container>
|
|
43
57
|
);
|
|
@@ -3,12 +3,16 @@ import { useLanguage } from 'ordering-components/native';
|
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
4
|
import { Container } from './styles';
|
|
5
5
|
import ODropDownCalendar from '../shared/ODropDownCalendar';
|
|
6
|
-
import { Platform } from 'react-native'
|
|
7
|
-
|
|
6
|
+
import { Button, Platform, Touchable, TouchableOpacity, View } from 'react-native'
|
|
7
|
+
import DoubleClick from 'react-native-double-tap'
|
|
8
|
+
import { OText } from '../shared';
|
|
9
|
+
import DoubleTap from 'react-native-double-tap';
|
|
8
10
|
export const OrdersOptionDate = (props: any) => {
|
|
9
11
|
const {
|
|
10
12
|
search,
|
|
11
|
-
onSearch
|
|
13
|
+
onSearch,
|
|
14
|
+
setOpenedSelect,
|
|
15
|
+
openedSelect
|
|
12
16
|
} = props
|
|
13
17
|
|
|
14
18
|
const theme = useTheme();
|
|
@@ -22,18 +26,23 @@ export const OrdersOptionDate = (props: any) => {
|
|
|
22
26
|
|
|
23
27
|
const handleChangeOption = (option: any) => {
|
|
24
28
|
if (option === 'calendar') {
|
|
25
|
-
onSearch({...search, date: {...search.date, type: option}})
|
|
29
|
+
onSearch({ ...search, date: { ...search.date, type: option } })
|
|
26
30
|
} else {
|
|
27
|
-
onSearch({...search, date: {from: '', to: '', type: option}})
|
|
31
|
+
onSearch({ ...search, date: { from: '', to: '', type: option } })
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
const handleChangeDate = (from: any, to: any) => {
|
|
32
|
-
onSearch({...search, date: {...search.date, from: from, to: to}})
|
|
36
|
+
onSearch({ ...search, date: { ...search.date, from: from, to: to } })
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const handleOpenSelect = () => {
|
|
40
|
+
setOpenedSelect('calendar')
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
return (
|
|
36
44
|
<Container isIos={Platform.OS === 'ios'}>
|
|
45
|
+
|
|
37
46
|
<ODropDownCalendar
|
|
38
47
|
options={optionsList}
|
|
39
48
|
defaultValue={search.date.type}
|
|
@@ -47,6 +56,10 @@ export const OrdersOptionDate = (props: any) => {
|
|
|
47
56
|
rangeDate={search.date}
|
|
48
57
|
handleChangeDate={handleChangeDate}
|
|
49
58
|
isCalendarAlwaysVisible
|
|
59
|
+
handleClear={() => onSearch({ ...search, date: { from: '', to: '', type: '' } })}
|
|
60
|
+
handleOpenSelect={handleOpenSelect}
|
|
61
|
+
openedSelect={openedSelect}
|
|
62
|
+
selectType='calendar'
|
|
50
63
|
/>
|
|
51
64
|
</Container>
|
|
52
65
|
);
|
|
@@ -8,7 +8,9 @@ import { Platform } from 'react-native'
|
|
|
8
8
|
export const OrdersOptionDelivery = (props: any) => {
|
|
9
9
|
const {
|
|
10
10
|
search,
|
|
11
|
-
onSearch
|
|
11
|
+
onSearch,
|
|
12
|
+
setOpenedSelect,
|
|
13
|
+
openedSelect
|
|
12
14
|
} = props
|
|
13
15
|
|
|
14
16
|
const theme = useTheme();
|
|
@@ -18,6 +20,14 @@ export const OrdersOptionDelivery = (props: any) => {
|
|
|
18
20
|
{ value: '2', content: t('PICKUP', 'Pickup') }
|
|
19
21
|
]
|
|
20
22
|
|
|
23
|
+
const handleClear = () => {
|
|
24
|
+
onSearch({ ...search, delivery_type: '' })
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const handleOpenSelect = () => {
|
|
28
|
+
setOpenedSelect('delivery_type')
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
return (
|
|
22
32
|
<Container isIos={Platform.OS === 'ios'}>
|
|
23
33
|
<ODropDown
|
|
@@ -29,6 +39,10 @@ export const OrdersOptionDelivery = (props: any) => {
|
|
|
29
39
|
textcolor={theme.colors.unselectText}
|
|
30
40
|
placeholder={t('SELECT_DELIVERY_TYPE', 'Select Delivery type')}
|
|
31
41
|
dropViewMaxHeight={200}
|
|
42
|
+
handleClear={handleClear}
|
|
43
|
+
handleOpenSelect={handleOpenSelect}
|
|
44
|
+
openedSelect={openedSelect}
|
|
45
|
+
selectType='delivery_type'
|
|
32
46
|
/>
|
|
33
47
|
</Container>
|
|
34
48
|
);
|
|
@@ -9,7 +9,9 @@ export const OrdersOptionDriverUI = (props: any) => {
|
|
|
9
9
|
const {
|
|
10
10
|
search,
|
|
11
11
|
onSearch,
|
|
12
|
-
driverList
|
|
12
|
+
driverList,
|
|
13
|
+
setOpenedSelect,
|
|
14
|
+
openedSelect
|
|
13
15
|
} = props
|
|
14
16
|
|
|
15
17
|
const theme = useTheme();
|
|
@@ -24,6 +26,14 @@ export const OrdersOptionDriverUI = (props: any) => {
|
|
|
24
26
|
setOptionsList(drivers)
|
|
25
27
|
}, [driverList?.drivers])
|
|
26
28
|
|
|
29
|
+
const handleClear = () => {
|
|
30
|
+
onSearch({ ...search, driver: '' })
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const handleOpenSelect = () => {
|
|
34
|
+
setOpenedSelect('driver')
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
return (
|
|
28
38
|
<Container isIos={Platform.OS === 'ios'}>
|
|
29
39
|
<ODropDown
|
|
@@ -35,6 +45,10 @@ export const OrdersOptionDriverUI = (props: any) => {
|
|
|
35
45
|
textcolor={theme.colors.unselectText}
|
|
36
46
|
placeholder={t('SELECT_DRIVER', 'Select Driver')}
|
|
37
47
|
dropViewMaxHeight={165}
|
|
48
|
+
handleClear={handleClear}
|
|
49
|
+
handleOpenSelect={handleOpenSelect}
|
|
50
|
+
openedSelect={openedSelect}
|
|
51
|
+
selectType='driver'
|
|
38
52
|
/>
|
|
39
53
|
</Container>
|
|
40
54
|
);
|
|
@@ -9,7 +9,9 @@ export const OrdersOptionPaymethodUI = (props: any) => {
|
|
|
9
9
|
const {
|
|
10
10
|
search,
|
|
11
11
|
onSearch,
|
|
12
|
-
paymethodList
|
|
12
|
+
paymethodList,
|
|
13
|
+
setOpenedSelect,
|
|
14
|
+
openedSelect
|
|
13
15
|
} = props
|
|
14
16
|
|
|
15
17
|
const theme = useTheme();
|
|
@@ -24,6 +26,14 @@ export const OrdersOptionPaymethodUI = (props: any) => {
|
|
|
24
26
|
setOptionsList(paymethods)
|
|
25
27
|
}, [paymethodList?.paymethods])
|
|
26
28
|
|
|
29
|
+
const handleClear = () => {
|
|
30
|
+
onSearch({ ...search, paymethod: '' })
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const handleOpenSelect = () => {
|
|
34
|
+
setOpenedSelect('paymethod')
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
return (
|
|
28
38
|
<Container isIos={Platform.OS === 'ios'}>
|
|
29
39
|
<ODropDown
|
|
@@ -35,6 +45,10 @@ export const OrdersOptionPaymethodUI = (props: any) => {
|
|
|
35
45
|
textcolor={theme.colors.unselectText}
|
|
36
46
|
placeholder={t('SELECT_PAYMETHOD', 'Select Paymethod')}
|
|
37
47
|
dropViewMaxHeight={200}
|
|
48
|
+
handleClear={handleClear}
|
|
49
|
+
handleOpenSelect={handleOpenSelect}
|
|
50
|
+
openedSelect={openedSelect}
|
|
51
|
+
selectType='paymethod'
|
|
38
52
|
/>
|
|
39
53
|
</Container>
|
|
40
54
|
);
|
|
@@ -11,7 +11,9 @@ export const OrdersOptionStatus = (props: any) => {
|
|
|
11
11
|
tabs,
|
|
12
12
|
orderStatus,
|
|
13
13
|
search,
|
|
14
|
-
onSearch
|
|
14
|
+
onSearch,
|
|
15
|
+
setOpenedSelect,
|
|
16
|
+
openedSelect
|
|
15
17
|
} = props
|
|
16
18
|
|
|
17
19
|
const theme = useTheme();
|
|
@@ -29,6 +31,10 @@ export const OrdersOptionStatus = (props: any) => {
|
|
|
29
31
|
setOptionsList(_optionList)
|
|
30
32
|
}, [currentTabSelected, tabs, orderStatus])
|
|
31
33
|
|
|
34
|
+
const handleOpenSelect = () => {
|
|
35
|
+
setOpenedSelect('state')
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
return (
|
|
33
39
|
<Container isIos={Platform.OS === 'ios'}>
|
|
34
40
|
<ODropDown
|
|
@@ -40,6 +46,9 @@ export const OrdersOptionStatus = (props: any) => {
|
|
|
40
46
|
textcolor={theme.colors.unselectText}
|
|
41
47
|
placeholder={t('SELECT_STATUS', 'Select Status')}
|
|
42
48
|
dropViewMaxHeight={200}
|
|
49
|
+
handleOpenSelect={handleOpenSelect}
|
|
50
|
+
openedSelect={openedSelect}
|
|
51
|
+
selectType='state'
|
|
43
52
|
/>
|
|
44
53
|
</Container>
|
|
45
54
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
useLanguage,
|
|
4
4
|
useUtils,
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
View,
|
|
11
11
|
StyleSheet,
|
|
12
12
|
I18nManager,
|
|
13
|
-
TouchableOpacity
|
|
13
|
+
TouchableOpacity,
|
|
14
|
+
Keyboard
|
|
14
15
|
} from 'react-native'
|
|
15
16
|
import { useTheme } from 'styled-components/native'
|
|
16
17
|
import { ReviewCustomerParams } from '../../types'
|
|
@@ -52,7 +53,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
52
53
|
const { top, bottom } = useSafeAreaInsets()
|
|
53
54
|
const [comments, setComments] = useState<Array<any>>([])
|
|
54
55
|
const [extraComment, setExtraComment] = useState('')
|
|
55
|
-
|
|
56
|
+
const scrollref = useRef<any>()
|
|
56
57
|
const styles = StyleSheet.create({
|
|
57
58
|
photoWrapper: {
|
|
58
59
|
shadowColor: theme.colors.black,
|
|
@@ -142,6 +143,14 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
142
143
|
|
|
143
144
|
}, [actionState.error])
|
|
144
145
|
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if(scrollref?.current){
|
|
148
|
+
Keyboard.addListener('keyboardDidShow', () => {
|
|
149
|
+
scrollref.current.scrollToEnd()
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
}, [scrollref?.current])
|
|
153
|
+
|
|
145
154
|
return (
|
|
146
155
|
<KeyboardAvoidingView
|
|
147
156
|
enabled
|
|
@@ -179,6 +188,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
179
188
|
<Content
|
|
180
189
|
showsVerticalScrollIndicator={false}
|
|
181
190
|
contentContainerStyle={{ paddingBottom: 30 }}
|
|
191
|
+
ref={scrollref}
|
|
182
192
|
>
|
|
183
193
|
<CustomerInfoContainer>
|
|
184
194
|
<View
|
|
@@ -149,10 +149,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
|
|
|
149
149
|
width={12}
|
|
150
150
|
height={12}
|
|
151
151
|
color={theme.colors.skyBlue}
|
|
152
|
-
style={{ marginRight: 5 }}
|
|
152
|
+
style={{ marginRight: 5, marginTop: 3 }}
|
|
153
153
|
/>
|
|
154
154
|
<OText size={12}>
|
|
155
|
-
{t('MORE_SETTINGS_GO_TO', 'For more settings go to
|
|
155
|
+
{t('MORE_SETTINGS_GO_TO', 'For more settings go to')}{' '}
|
|
156
156
|
</OText>
|
|
157
157
|
<TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
|
|
158
158
|
<OText size={12} color={theme.colors.skyBlue}>
|
|
@@ -4,6 +4,7 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'
|
|
|
4
4
|
import { ScrollView as CustomScrollView, TouchableOpacity as CustomTouchableOpacity, View } from 'react-native'
|
|
5
5
|
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
6
6
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
7
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
7
8
|
import { Text } from 'react-native-paper';
|
|
8
9
|
|
|
9
10
|
interface Props {
|
|
@@ -16,7 +17,11 @@ interface Props {
|
|
|
16
17
|
dropViewMaxHeight?: any,
|
|
17
18
|
isModal?: any,
|
|
18
19
|
bgcolor?: string,
|
|
19
|
-
textcolor?: string
|
|
20
|
+
textcolor?: string,
|
|
21
|
+
handleClear?: any,
|
|
22
|
+
handleOpenSelect?: any,
|
|
23
|
+
openedSelect?: string,
|
|
24
|
+
selectType?: string
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
const Wrapper = styled.View`
|
|
@@ -70,7 +75,11 @@ const ODropDown = (props: Props) => {
|
|
|
70
75
|
placeholder,
|
|
71
76
|
onSelect,
|
|
72
77
|
dropViewMaxHeight,
|
|
73
|
-
isModal
|
|
78
|
+
isModal,
|
|
79
|
+
handleClear,
|
|
80
|
+
handleOpenSelect,
|
|
81
|
+
openedSelect,
|
|
82
|
+
selectType
|
|
74
83
|
} = props
|
|
75
84
|
|
|
76
85
|
const theme = useTheme();
|
|
@@ -82,6 +91,7 @@ const ODropDown = (props: Props) => {
|
|
|
82
91
|
|
|
83
92
|
const onToggle = () => {
|
|
84
93
|
setIsOpen(!isOpen)
|
|
94
|
+
if (!isOpen) handleOpenSelect?.()
|
|
85
95
|
}
|
|
86
96
|
|
|
87
97
|
const onSelectOption = (option: any) => {
|
|
@@ -91,12 +101,25 @@ const ODropDown = (props: Props) => {
|
|
|
91
101
|
setIsOpen(false)
|
|
92
102
|
}
|
|
93
103
|
|
|
104
|
+
const handleClearSearch = () => {
|
|
105
|
+
handleClear()
|
|
106
|
+
if (isOpen) {
|
|
107
|
+
onToggle()
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
94
111
|
useEffect(() => {
|
|
95
112
|
const _defaultOption = options?.find((option: any) => option.value === defaultValue)
|
|
96
113
|
setSelectedOption(_defaultOption)
|
|
97
114
|
setValue(defaultValue)
|
|
98
115
|
}, [defaultValue, options])
|
|
99
116
|
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (openedSelect !== selectType && typeof openedSelect === 'string') {
|
|
119
|
+
setIsOpen(false)
|
|
120
|
+
}
|
|
121
|
+
}, [openedSelect])
|
|
122
|
+
|
|
100
123
|
return (
|
|
101
124
|
<Wrapper style={props.style}>
|
|
102
125
|
<Selected
|
|
@@ -110,11 +133,22 @@ const ODropDown = (props: Props) => {
|
|
|
110
133
|
>
|
|
111
134
|
{selectedOption?.content || selectedOption?.name || placeholder}
|
|
112
135
|
</SelectedLabel>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
136
|
+
{selectedOption && handleClear ? (
|
|
137
|
+
<AntDesign
|
|
138
|
+
name={'close'}
|
|
139
|
+
size={20}
|
|
140
|
+
onPress={() => handleClearSearch()}
|
|
141
|
+
style={{ position: 'absolute', right: 12, top: 13 }}
|
|
142
|
+
/>
|
|
143
|
+
) : (
|
|
144
|
+
<FeatherIcon
|
|
145
|
+
name='chevron-down'
|
|
146
|
+
color={props.textcolor}
|
|
147
|
+
size={24}
|
|
148
|
+
style={{ position: 'absolute', right: 12, top: 13 }}
|
|
149
|
+
|
|
150
|
+
/>
|
|
151
|
+
)}
|
|
118
152
|
</Selected>
|
|
119
153
|
{isOpen && options && (
|
|
120
154
|
<DropView
|
|
@@ -154,7 +188,7 @@ const ODropDown = (props: Props) => {
|
|
|
154
188
|
maxHeight: dropViewMaxHeight || null,
|
|
155
189
|
paddingBottom: 15
|
|
156
190
|
}}
|
|
157
|
-
|
|
191
|
+
nestedScrollEnabled={true}
|
|
158
192
|
>
|
|
159
193
|
{options.map((option: any, index: number) => (
|
|
160
194
|
<CustomTouchableOpacity
|