ordering-ui-react-native 0.12.21 → 0.12.25
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/src/components/ActiveOrders/index.tsx +31 -14
- package/src/components/Messages/index.tsx +59 -4
- package/src/components/Messages/styles.tsx +3 -0
- package/themes/business/src/components/Chat/index.tsx +56 -8
- package/themes/business/src/components/Chat/styles.tsx +4 -0
- package/themes/doordash/src/components/Messages/index.tsx +62 -4
- package/themes/doordash/src/components/Messages/styles.tsx +2 -0
- package/themes/doordash/src/components/shared/OButton.tsx +2 -1
- package/themes/instacart/src/components/Messages/index.tsx +60 -5
- package/themes/instacart/src/components/Messages/styles.tsx +2 -0
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +7 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +8 -1
- package/themes/original/src/components/Messages/index.tsx +61 -5
- package/themes/original/src/components/Messages/styles.tsx +2 -2
- package/themes/original/src/components/ProductForm/index.tsx +40 -24
- package/themes/single-business/index.tsx +4 -0
- package/themes/single-business/src/components/AddressList/index.tsx +2 -2
- package/themes/single-business/src/components/BusinessProductsCategories/index.tsx +89 -16
- package/themes/single-business/src/components/BusinessProductsList/index.tsx +22 -8
- package/themes/single-business/src/components/BusinessProductsList/styles.tsx +1 -1
- package/themes/single-business/src/components/BusinessProductsListing/index.tsx +71 -26
- package/themes/single-business/src/components/LoginForm/index.tsx +43 -26
- package/themes/single-business/src/components/OrderListOption/index.tsx +231 -0
- package/themes/single-business/src/components/OrderListOption/styles.tsx +62 -0
- package/themes/single-business/src/components/OrdersListing/index.tsx +112 -0
- package/themes/single-business/src/components/SignupForm/index.tsx +15 -16
- package/themes/single-business/src/components/UserProfile/index.tsx +9 -3
- package/themes/single-business/src/types/index.tsx +9 -0
- package/themes/single-business/src/utils/index.tsx +32 -1
- package/themes/uber-eats/src/components/Messages/index.tsx +59 -4
- package/themes/uber-eats/src/components/Messages/styles.tsx +2 -0
package/package.json
CHANGED
|
@@ -3,10 +3,11 @@ import { useLanguage, useUtils, useConfig } from 'ordering-components/native'
|
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
4
|
import { OButton, OIcon, OText } from '../shared'
|
|
5
5
|
import { ActiveOrdersContainer, Card, Map, Information, Logo, OrderInformation, BusinessInformation, Price } from './styles'
|
|
6
|
-
import { View, StyleSheet } from 'react-native'
|
|
6
|
+
import { View, StyleSheet, TouchableWithoutFeedback } from 'react-native'
|
|
7
7
|
import { getGoogleMapImage } from '../../utils'
|
|
8
8
|
|
|
9
9
|
import { ActiveOrdersParams } from '../../types'
|
|
10
|
+
import { ScrollView as GestureHandlerScrollView } from 'react-native-gesture-handler'
|
|
10
11
|
|
|
11
12
|
export const ActiveOrders = (props: ActiveOrdersParams) => {
|
|
12
13
|
const {
|
|
@@ -73,19 +74,35 @@ export const ActiveOrders = (props: ActiveOrdersParams) => {
|
|
|
73
74
|
)}
|
|
74
75
|
<OrderInformation>
|
|
75
76
|
<BusinessInformation style={{ width: '60%' }}>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
<GestureHandlerScrollView
|
|
78
|
+
showsVerticalScrollIndicator={false}
|
|
79
|
+
showsHorizontalScrollIndicator={false}
|
|
80
|
+
horizontal
|
|
81
|
+
>
|
|
82
|
+
<TouchableWithoutFeedback>
|
|
83
|
+
<View>
|
|
84
|
+
<OText
|
|
85
|
+
size={16}
|
|
86
|
+
numberOfLines={1}
|
|
87
|
+
ellipsizeMode='tail'
|
|
88
|
+
>
|
|
89
|
+
{order.business?.name}
|
|
90
|
+
</OText>
|
|
91
|
+
</View>
|
|
92
|
+
</TouchableWithoutFeedback>
|
|
93
|
+
</GestureHandlerScrollView>
|
|
94
|
+
<GestureHandlerScrollView
|
|
95
|
+
showsVerticalScrollIndicator={false}
|
|
96
|
+
showsHorizontalScrollIndicator={false}
|
|
97
|
+
horizontal
|
|
98
|
+
>
|
|
99
|
+
<TouchableWithoutFeedback>
|
|
100
|
+
<View style={styles.orderNumber}>
|
|
101
|
+
<OText size={12} space color={theme.colors.textSecondary}>{t('ORDER_NUMBER', 'Order No.')}</OText>
|
|
102
|
+
<OText size={12} color={theme.colors.textSecondary}>{order.id}</OText>
|
|
103
|
+
</View>
|
|
104
|
+
</TouchableWithoutFeedback>
|
|
105
|
+
</GestureHandlerScrollView>
|
|
89
106
|
<OText size={12} color={theme.colors.textSecondary}>{order?.delivery_datetime_utc
|
|
90
107
|
? parseDate(order?.delivery_datetime_utc)
|
|
91
108
|
: parseDate(order?.delivery_datetime, { utc: false })}</OText>
|
|
@@ -5,9 +5,9 @@ import { useTheme } from 'styled-components/native';
|
|
|
5
5
|
import { GiftedChat, Actions, InputToolbar, Composer, Send, Bubble, MessageImage } from 'react-native-gifted-chat'
|
|
6
6
|
import { USER_TYPE } from '../../config/constants'
|
|
7
7
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
8
|
-
import { OIcon, OIconButton, OText } from '../shared'
|
|
8
|
+
import { OIcon, OIconButton, OText, OButton } from '../shared'
|
|
9
9
|
import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboard,I18nManager } from 'react-native'
|
|
10
|
-
import { Header, TitleHeader, Wrapper } from './styles'
|
|
10
|
+
import { Header, TitleHeader, Wrapper, QuickMessageContainer } from './styles'
|
|
11
11
|
import { MessagesParams } from '../../types'
|
|
12
12
|
|
|
13
13
|
const ImageDummy = require('../../assets/images/image.png')
|
|
@@ -66,6 +66,13 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
66
66
|
const [, { showToast }] = useToast();
|
|
67
67
|
const theme = useTheme();
|
|
68
68
|
|
|
69
|
+
const quickMessageList = [
|
|
70
|
+
{ key: 'driver_message_1', text: t('DRIVER_MESSAGE_1', 'driver_message_1') },
|
|
71
|
+
{ key: 'driver_message_2', text: t('DRIVER_MESSAGE_2', 'driver_message_2') },
|
|
72
|
+
{ key: 'driver_message_3', text: t('DRIVER_MESSAGE_3', 'driver_message_3') },
|
|
73
|
+
{ key: 'driver_message_4', text: t('DRIVER_MESSAGE_4', 'driver_message_4') }
|
|
74
|
+
]
|
|
75
|
+
|
|
69
76
|
const [formattedMessages, setFormattedMessages] = useState<Array<any>>([])
|
|
70
77
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false)
|
|
71
78
|
|
|
@@ -76,6 +83,10 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
76
83
|
setMessage && setMessage(val)
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
const handleClickQuickMessage = (text: string) => {
|
|
87
|
+
setMessage && setMessage(`${message}${text}`)
|
|
88
|
+
}
|
|
89
|
+
|
|
79
90
|
const removeImage = () => {
|
|
80
91
|
setImage && setImage(null)
|
|
81
92
|
}
|
|
@@ -198,12 +209,47 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
198
209
|
<InputToolbar
|
|
199
210
|
{...props}
|
|
200
211
|
containerStyle={{
|
|
201
|
-
padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10
|
|
212
|
+
padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10,
|
|
213
|
+
flexDirection: 'column-reverse'
|
|
202
214
|
}}
|
|
203
215
|
primaryStyle={{ alignItems: 'center', justifyContent: 'flex-start' }}
|
|
216
|
+
renderAccessory={() => renderAccessory()}
|
|
204
217
|
/>
|
|
205
218
|
)
|
|
206
219
|
|
|
220
|
+
const renderAccessory = () => {
|
|
221
|
+
return (
|
|
222
|
+
<QuickMessageContainer
|
|
223
|
+
style={{
|
|
224
|
+
marginLeft: 10,
|
|
225
|
+
marginBottom: 10
|
|
226
|
+
}}
|
|
227
|
+
contentContainerStyle={{
|
|
228
|
+
alignItems: 'center',
|
|
229
|
+
}}
|
|
230
|
+
horizontal
|
|
231
|
+
showsHorizontalScrollIndicator={false}
|
|
232
|
+
>
|
|
233
|
+
{quickMessageList.map((quickMessage, i) => (
|
|
234
|
+
<OButton
|
|
235
|
+
key={i}
|
|
236
|
+
text={quickMessage.text}
|
|
237
|
+
bgColor='#E9ECEF'
|
|
238
|
+
borderColor='#E9ECEF'
|
|
239
|
+
imgRightSrc={null}
|
|
240
|
+
textStyle={{
|
|
241
|
+
fontSize: 11,
|
|
242
|
+
lineHeight: 16,
|
|
243
|
+
color: '#414954'
|
|
244
|
+
}}
|
|
245
|
+
style={{ ...styles.editButton }}
|
|
246
|
+
onClick={() => handleClickQuickMessage(quickMessage.text)}
|
|
247
|
+
/>
|
|
248
|
+
))}
|
|
249
|
+
</QuickMessageContainer>
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
|
|
207
253
|
const renderComposer = (props: any) => (
|
|
208
254
|
chatDisabled ? (
|
|
209
255
|
<View
|
|
@@ -337,7 +383,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
337
383
|
renderMessageImage={renderMessageImage}
|
|
338
384
|
scrollToBottomComponent={() => renderScrollToBottomComponent()}
|
|
339
385
|
messagesContainerStyle={{
|
|
340
|
-
paddingBottom:
|
|
386
|
+
paddingBottom: 55
|
|
341
387
|
}}
|
|
342
388
|
isLoadingEarlier={messages.loading}
|
|
343
389
|
renderLoading={() => <ActivityIndicator size="small" color="#000" />}
|
|
@@ -363,6 +409,15 @@ const styles = StyleSheet.create({
|
|
|
363
409
|
alignItems: 'center',
|
|
364
410
|
justifyContent: 'center',
|
|
365
411
|
marginHorizontal: 4
|
|
412
|
+
},
|
|
413
|
+
editButton : {
|
|
414
|
+
borderRadius: 50,
|
|
415
|
+
backgroundColor: '#E9ECEF',
|
|
416
|
+
marginRight: 10,
|
|
417
|
+
height: 24,
|
|
418
|
+
borderWidth: 1,
|
|
419
|
+
paddingLeft: 0,
|
|
420
|
+
paddingRight: 0
|
|
366
421
|
}
|
|
367
422
|
})
|
|
368
423
|
|
|
@@ -5,6 +5,7 @@ export const Wrapper = styled.View`
|
|
|
5
5
|
flex: 1;
|
|
6
6
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
7
7
|
`
|
|
8
|
+
|
|
8
9
|
export const Header = styled.View`
|
|
9
10
|
flex-direction: row;
|
|
10
11
|
align-items: center;
|
|
@@ -19,3 +20,5 @@ export const TitleHeader = styled.View`
|
|
|
19
20
|
align-items: flex-start;
|
|
20
21
|
max-width: 85%;
|
|
21
22
|
`
|
|
23
|
+
|
|
24
|
+
export const QuickMessageContainer = styled.ScrollView``
|
|
@@ -37,8 +37,8 @@ import {
|
|
|
37
37
|
useUtils,
|
|
38
38
|
useLanguage,
|
|
39
39
|
} from 'ordering-components/native';
|
|
40
|
-
import { Header, TitleHeader, Wrapper } from './styles';
|
|
41
|
-
import { OIcon, OIconButton, OText } from '../shared';
|
|
40
|
+
import { Header, TitleHeader, Wrapper, QuickMessageContainer } from './styles';
|
|
41
|
+
import { OIcon, OIconButton, OText, OButton } from '../shared';
|
|
42
42
|
import { MessagesParams } from '../../types';
|
|
43
43
|
import { USER_TYPE } from '../../config/constants';
|
|
44
44
|
|
|
@@ -67,6 +67,17 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
67
67
|
const [, { showToast }] = useToast();
|
|
68
68
|
const theme = useTheme();
|
|
69
69
|
|
|
70
|
+
const quickMessageList = [
|
|
71
|
+
{ key: 'store_message_1', text: t('STORE_MESSAGE_1', 'store_message_1') },
|
|
72
|
+
{ key: 'store_message_2', text: t('STORE_MESSAGE_2', 'store_message_2') },
|
|
73
|
+
{ key: 'store_message_3', text: t('STORE_MESSAGE_3', 'store_message_3') },
|
|
74
|
+
{ key: 'store_message_4', text: t('STORE_MESSAGE_4', 'store_message_4') }
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
const handleClickQuickMessage = (text: string) => {
|
|
78
|
+
setMessage && setMessage(`${message}${text}`)
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
const { bottom } = useSafeAreaInsets();
|
|
71
82
|
|
|
72
83
|
const [formattedMessages, setFormattedMessages] = useState<Array<any>>([]);
|
|
@@ -131,6 +142,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
131
142
|
accessoryIcon: {
|
|
132
143
|
height: 32,
|
|
133
144
|
width: 32,
|
|
145
|
+
minWidth: 32,
|
|
134
146
|
borderRadius: 7.6,
|
|
135
147
|
resizeMode: 'stretch',
|
|
136
148
|
},
|
|
@@ -198,6 +210,15 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
198
210
|
paddingLeft: 12,
|
|
199
211
|
paddingRight: 5,
|
|
200
212
|
},
|
|
213
|
+
editButton : {
|
|
214
|
+
borderRadius: 50,
|
|
215
|
+
backgroundColor: '#E9ECEF',
|
|
216
|
+
marginRight: 10,
|
|
217
|
+
height: 24,
|
|
218
|
+
borderWidth: 1,
|
|
219
|
+
paddingLeft: 0,
|
|
220
|
+
paddingRight: 0
|
|
221
|
+
}
|
|
201
222
|
});
|
|
202
223
|
const [file, setFile] = useState({
|
|
203
224
|
uri: '',
|
|
@@ -590,6 +611,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
590
611
|
};
|
|
591
612
|
|
|
592
613
|
const renderAccessory = () => (
|
|
614
|
+
<View>
|
|
593
615
|
<Header
|
|
594
616
|
showsVerticalScrollIndicator={false}
|
|
595
617
|
showsHorizontalScrollIndicator={false}
|
|
@@ -636,7 +658,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
636
658
|
<OText
|
|
637
659
|
adjustsFontSizeToFit
|
|
638
660
|
color={theme.colors.unselectText}
|
|
639
|
-
size={
|
|
661
|
+
size={13}>
|
|
640
662
|
{t('BUSINESS', 'Business')}
|
|
641
663
|
</OText>
|
|
642
664
|
</TitleHeader>
|
|
@@ -677,7 +699,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
677
699
|
<OText
|
|
678
700
|
adjustsFontSizeToFit
|
|
679
701
|
color={theme.colors.unselectText}
|
|
680
|
-
size={
|
|
702
|
+
size={13}>
|
|
681
703
|
{t('CUSTOMER', 'Customer')}
|
|
682
704
|
</OText>
|
|
683
705
|
</TitleHeader>
|
|
@@ -718,13 +740,39 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
718
740
|
<OText
|
|
719
741
|
adjustsFontSizeToFit
|
|
720
742
|
color={theme.colors.unselectText}
|
|
721
|
-
size={
|
|
743
|
+
size={13}>
|
|
722
744
|
{t('DRIVER', 'Driver')}
|
|
723
745
|
</OText>
|
|
724
746
|
</TitleHeader>
|
|
725
747
|
</Pressable>
|
|
726
748
|
)}
|
|
727
749
|
</Header>
|
|
750
|
+
<QuickMessageContainer
|
|
751
|
+
contentContainerStyle={{
|
|
752
|
+
alignItems: 'center'
|
|
753
|
+
}}
|
|
754
|
+
horizontal
|
|
755
|
+
showsHorizontalScrollIndicator={false}
|
|
756
|
+
>
|
|
757
|
+
{quickMessageList.map((quickMessage, i) => (
|
|
758
|
+
<OButton
|
|
759
|
+
key={i}
|
|
760
|
+
text={quickMessage.text}
|
|
761
|
+
bgColor='#E9ECEF'
|
|
762
|
+
borderColor='#E9ECEF'
|
|
763
|
+
imgRightSrc={null}
|
|
764
|
+
textStyle={{
|
|
765
|
+
fontSize: 11,
|
|
766
|
+
lineHeight: 16,
|
|
767
|
+
color: '#414954'
|
|
768
|
+
}}
|
|
769
|
+
style={{ ...styles.editButton }}
|
|
770
|
+
onClick={() => handleClickQuickMessage(quickMessage.text)}
|
|
771
|
+
/>
|
|
772
|
+
))}
|
|
773
|
+
</QuickMessageContainer>
|
|
774
|
+
</View>
|
|
775
|
+
|
|
728
776
|
);
|
|
729
777
|
|
|
730
778
|
const userRoles: any = {
|
|
@@ -741,7 +789,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
741
789
|
{...props}
|
|
742
790
|
containerStyle={styles.toolbarStyle}
|
|
743
791
|
primaryStyle={{ alignItems: 'center', justifyContent: 'space-between' }}
|
|
744
|
-
accessoryStyle={{ position: 'relative', marginBottom:
|
|
792
|
+
accessoryStyle={{ position: 'relative', marginBottom: 45 }}
|
|
745
793
|
renderAccessory={order ? () => renderAccessory && renderAccessory() : undefined}
|
|
746
794
|
/>
|
|
747
795
|
);
|
|
@@ -1128,10 +1176,10 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
1128
1176
|
renderBubble={renderBubble}
|
|
1129
1177
|
renderMessageImage={renderMessageImage}
|
|
1130
1178
|
scrollToBottomComponent={() => renderScrollToBottomComponent()}
|
|
1131
|
-
messagesContainerStyle={{ paddingBottom:
|
|
1179
|
+
messagesContainerStyle={{ paddingBottom: 25 }}
|
|
1132
1180
|
showUserAvatar={true}
|
|
1133
1181
|
bottomOffset={bottom}
|
|
1134
|
-
minInputToolbarHeight={
|
|
1182
|
+
minInputToolbarHeight={145}
|
|
1135
1183
|
isLoadingEarlier={messages?.loading}
|
|
1136
1184
|
renderLoading={() => (
|
|
1137
1185
|
<ActivityIndicator size="small" color={theme.colors.black} />
|
|
@@ -5,9 +5,9 @@ import { GiftedChat, Actions, InputToolbar, Composer, Send, Bubble, MessageImage
|
|
|
5
5
|
import { USER_TYPE } from '../../config/constants'
|
|
6
6
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
7
7
|
import { useTheme } from 'styled-components/native'
|
|
8
|
-
import { OIcon, OIconButton, OText } from '../shared'
|
|
8
|
+
import { OIcon, OIconButton, OText, OButton } from '../shared'
|
|
9
9
|
import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboard, I18nManager } from 'react-native'
|
|
10
|
-
import { Header, TitleHeader, Wrapper } from './styles'
|
|
10
|
+
import { Header, TitleHeader, Wrapper, QuickMessageContainer } from './styles'
|
|
11
11
|
import { MessagesParams } from '../../types'
|
|
12
12
|
|
|
13
13
|
const MessagesUI = (props: MessagesParams) => {
|
|
@@ -33,9 +33,20 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
33
33
|
const [, t] = useLanguage()
|
|
34
34
|
const [, { showToast }] = useToast();
|
|
35
35
|
|
|
36
|
+
const quickMessageList = [
|
|
37
|
+
{ key: 'customer_message_1', text: t('CUSTOMER_MESSAGE_1', 'customer_message_1') },
|
|
38
|
+
{ key: 'customer_message_2', text: t('CUSTOMER_MESSAGE_2', 'customer_message_2') },
|
|
39
|
+
{ key: 'customer_message_3', text: t('CUSTOMER_MESSAGE_3', 'customer_message_3') },
|
|
40
|
+
{ key: 'customer_message_4', text: t('CUSTOMER_MESSAGE_4', 'customer_message_4') }
|
|
41
|
+
]
|
|
42
|
+
|
|
36
43
|
const [formattedMessages, setFormattedMessages] = useState<Array<any>>([])
|
|
37
44
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false)
|
|
38
45
|
|
|
46
|
+
const handleClickQuickMessage = (text: string) => {
|
|
47
|
+
setMessage && setMessage(`${message}${text}`)
|
|
48
|
+
}
|
|
49
|
+
|
|
39
50
|
const onChangeMessage = (val: string) => {
|
|
40
51
|
setMessage && setMessage(val)
|
|
41
52
|
}
|
|
@@ -220,13 +231,51 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
220
231
|
)
|
|
221
232
|
}
|
|
222
233
|
|
|
234
|
+
const renderAccessory = () => {
|
|
235
|
+
return (
|
|
236
|
+
<QuickMessageContainer
|
|
237
|
+
style={{
|
|
238
|
+
marginLeft: 10,
|
|
239
|
+
marginBottom: 10
|
|
240
|
+
}}
|
|
241
|
+
contentContainerStyle={{
|
|
242
|
+
alignItems: 'center',
|
|
243
|
+
}}
|
|
244
|
+
horizontal
|
|
245
|
+
showsHorizontalScrollIndicator={false}
|
|
246
|
+
>
|
|
247
|
+
{quickMessageList.map((quickMessage, i) => (
|
|
248
|
+
<OButton
|
|
249
|
+
key={i}
|
|
250
|
+
text={quickMessage.text}
|
|
251
|
+
bgColor='#E9ECEF'
|
|
252
|
+
borderColor='#E9ECEF'
|
|
253
|
+
imgRightSrc={null}
|
|
254
|
+
textStyle={{
|
|
255
|
+
fontSize: 11,
|
|
256
|
+
lineHeight: 16,
|
|
257
|
+
color: '#414954'
|
|
258
|
+
}}
|
|
259
|
+
wrapperStyle={{
|
|
260
|
+
width: 'auto'
|
|
261
|
+
}}
|
|
262
|
+
style={{ ...styles.editButton }}
|
|
263
|
+
onClick={() => handleClickQuickMessage(quickMessage.text)}
|
|
264
|
+
/>
|
|
265
|
+
))}
|
|
266
|
+
</QuickMessageContainer>
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
|
|
223
270
|
const renderInputToolbar = (props: any) => (
|
|
224
271
|
<InputToolbar
|
|
225
272
|
{...props}
|
|
226
273
|
containerStyle={{
|
|
227
|
-
padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10
|
|
274
|
+
padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10,
|
|
275
|
+
flexDirection: 'column-reverse'
|
|
228
276
|
}}
|
|
229
277
|
primaryStyle={{ alignItems: 'center', justifyContent: 'flex-start' }}
|
|
278
|
+
renderAccessory={() => renderAccessory()}
|
|
230
279
|
/>
|
|
231
280
|
)
|
|
232
281
|
|
|
@@ -347,7 +396,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
347
396
|
renderMessageImage={renderMessageImage}
|
|
348
397
|
scrollToBottomComponent={() => renderScrollToBottomComponent()}
|
|
349
398
|
messagesContainerStyle={{
|
|
350
|
-
paddingBottom:
|
|
399
|
+
paddingBottom: 55
|
|
351
400
|
}}
|
|
352
401
|
isLoadingEarlier={messages.loading}
|
|
353
402
|
renderLoading={() => <ActivityIndicator size="small" color="#000" />}
|
|
@@ -373,6 +422,15 @@ const styles = StyleSheet.create({
|
|
|
373
422
|
alignItems: 'center',
|
|
374
423
|
justifyContent: 'center',
|
|
375
424
|
marginHorizontal: 4
|
|
425
|
+
},
|
|
426
|
+
editButton : {
|
|
427
|
+
borderRadius: 50,
|
|
428
|
+
backgroundColor: '#E9ECEF',
|
|
429
|
+
marginRight: 10,
|
|
430
|
+
height: 24,
|
|
431
|
+
borderWidth: 1,
|
|
432
|
+
paddingLeft: 0,
|
|
433
|
+
paddingRight: 0
|
|
376
434
|
}
|
|
377
435
|
})
|
|
378
436
|
|
|
@@ -47,6 +47,7 @@ interface Props {
|
|
|
47
47
|
bgColor?: string;
|
|
48
48
|
borderColor?: string;
|
|
49
49
|
loadingStyle?: ViewStyle;
|
|
50
|
+
wrapperStyle?: ViewStyle
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
const StyledButton = styled.View<Props>`
|
|
@@ -114,7 +115,7 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
114
115
|
<StyledImage style={{ transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }], ...props.imgLeftStyle }} source={props.imgLeftSrc} />
|
|
115
116
|
) : null}
|
|
116
117
|
{props.text ? (
|
|
117
|
-
<View style={{ width: '100%', flexDirection: 'row', alignItems: 'center', justifyContent: props.textSub ? 'space-between' : 'center' }}>
|
|
118
|
+
<View style={{ width: '100%', flexDirection: 'row', alignItems: 'center', justifyContent: props.textSub ? 'space-between' : 'center', ...props.wrapperStyle }}>
|
|
118
119
|
<StyledText style={props.textStyle}>{props.text}</StyledText>
|
|
119
120
|
{props.textSub ? <StyledText style={props.textStyle}>{props.textSub}</StyledText> : null}
|
|
120
121
|
</View>
|
|
@@ -5,9 +5,9 @@ import { useTheme } from 'styled-components/native';
|
|
|
5
5
|
import { GiftedChat, Actions, InputToolbar, Composer, Send, Bubble, MessageImage } from 'react-native-gifted-chat'
|
|
6
6
|
import { USER_TYPE } from '../../config/constants'
|
|
7
7
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
8
|
-
import { OIcon, OIconButton, OText } from '../shared'
|
|
8
|
+
import { OIcon, OIconButton, OText, OButton } from '../shared'
|
|
9
9
|
import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboard, I18nManager } from 'react-native'
|
|
10
|
-
import { Header, TitleHeader, Wrapper } from './styles'
|
|
10
|
+
import { Header, TitleHeader, Wrapper, QuickMessageContainer } from './styles'
|
|
11
11
|
import { MessagesParams } from '../../types'
|
|
12
12
|
|
|
13
13
|
const ORDER_STATUS: any = {
|
|
@@ -61,6 +61,17 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
61
61
|
const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
62
62
|
const chatDisabled = previousStatus.includes(order?.status)
|
|
63
63
|
|
|
64
|
+
const quickMessageList = [
|
|
65
|
+
{ key: 'customer_message_1', text: t('CUSTOMER_MESSAGE_1', 'customer_message_1') },
|
|
66
|
+
{ key: 'customer_message_2', text: t('CUSTOMER_MESSAGE_2', 'customer_message_2') },
|
|
67
|
+
{ key: 'customer_message_3', text: t('CUSTOMER_MESSAGE_3', 'customer_message_3') },
|
|
68
|
+
{ key: 'customer_message_4', text: t('CUSTOMER_MESSAGE_4', 'customer_message_4') }
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
const handleClickQuickMessage = (text: string) => {
|
|
72
|
+
setMessage && setMessage(`${message}${text}`)
|
|
73
|
+
}
|
|
74
|
+
|
|
64
75
|
const onChangeMessage = (val: string) => {
|
|
65
76
|
setMessage && setMessage(val)
|
|
66
77
|
}
|
|
@@ -193,13 +204,48 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
193
204
|
)
|
|
194
205
|
}
|
|
195
206
|
|
|
207
|
+
const renderAccessory = () => {
|
|
208
|
+
return (
|
|
209
|
+
<QuickMessageContainer
|
|
210
|
+
style={{
|
|
211
|
+
marginLeft: 10,
|
|
212
|
+
marginBottom: 10
|
|
213
|
+
}}
|
|
214
|
+
contentContainerStyle={{
|
|
215
|
+
alignItems: 'center',
|
|
216
|
+
}}
|
|
217
|
+
horizontal
|
|
218
|
+
showsHorizontalScrollIndicator={false}
|
|
219
|
+
>
|
|
220
|
+
{quickMessageList.map((quickMessage, i) => (
|
|
221
|
+
<OButton
|
|
222
|
+
key={i}
|
|
223
|
+
text={quickMessage.text}
|
|
224
|
+
bgColor='#E9ECEF'
|
|
225
|
+
borderColor='#E9ECEF'
|
|
226
|
+
imgRightSrc={null}
|
|
227
|
+
textStyle={{
|
|
228
|
+
fontSize: 11,
|
|
229
|
+
lineHeight: 16,
|
|
230
|
+
color: '#414954'
|
|
231
|
+
}}
|
|
232
|
+
style={{ ...styles.editButton }}
|
|
233
|
+
onClick={() => handleClickQuickMessage(quickMessage.text)}
|
|
234
|
+
/>
|
|
235
|
+
))}
|
|
236
|
+
</QuickMessageContainer>
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
196
240
|
const renderInputToolbar = (props: any) => (
|
|
197
241
|
<InputToolbar
|
|
198
242
|
{...props}
|
|
199
243
|
containerStyle={{
|
|
200
|
-
padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10
|
|
244
|
+
padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10,
|
|
245
|
+
flexDirection: 'column-reverse'
|
|
201
246
|
}}
|
|
202
247
|
primaryStyle={{ alignItems: 'center', justifyContent: 'flex-start' }}
|
|
248
|
+
renderAccessory={() => renderAccessory()}
|
|
203
249
|
/>
|
|
204
250
|
)
|
|
205
251
|
|
|
@@ -337,7 +383,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
337
383
|
renderMessageImage={renderMessageImage}
|
|
338
384
|
scrollToBottomComponent={() => renderScrollToBottomComponent()}
|
|
339
385
|
messagesContainerStyle={{
|
|
340
|
-
paddingBottom:
|
|
386
|
+
paddingBottom: 55
|
|
341
387
|
}}
|
|
342
388
|
isLoadingEarlier={messages.loading}
|
|
343
389
|
renderLoading={() => <ActivityIndicator size="small" color="#000" />}
|
|
@@ -363,7 +409,16 @@ const styles = StyleSheet.create({
|
|
|
363
409
|
alignItems: 'center',
|
|
364
410
|
justifyContent: 'center',
|
|
365
411
|
marginHorizontal: 4
|
|
366
|
-
}
|
|
412
|
+
},
|
|
413
|
+
editButton : {
|
|
414
|
+
borderRadius: 50,
|
|
415
|
+
backgroundColor: '#E9ECEF',
|
|
416
|
+
marginRight: 10,
|
|
417
|
+
height: 24,
|
|
418
|
+
borderWidth: 1,
|
|
419
|
+
paddingLeft: 0,
|
|
420
|
+
paddingRight: 0
|
|
421
|
+
}
|
|
367
422
|
})
|
|
368
423
|
|
|
369
424
|
export const Messages = (props: MessagesParams) => {
|
|
@@ -91,7 +91,13 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
91
91
|
const _renderCategories = (): React.ReactElement => (
|
|
92
92
|
<>
|
|
93
93
|
{_renderTitle(t('CATEGORIES', 'Categories'))}
|
|
94
|
-
<GridContainer
|
|
94
|
+
<GridContainer
|
|
95
|
+
style={{
|
|
96
|
+
paddingLeft: orientationState?.orientation === LANDSCAPE
|
|
97
|
+
? bottomSheetVisibility ? orientationState?.dimensions?.width * 0.004 :orientationState?.dimensions?.width * 0.008
|
|
98
|
+
: 0
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
95
101
|
{_categories && _categories.map((category: any) => (
|
|
96
102
|
<OCard
|
|
97
103
|
key={category.id}
|
|
@@ -144,7 +144,14 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
144
144
|
/>
|
|
145
145
|
</View>
|
|
146
146
|
|
|
147
|
-
<GridContainer
|
|
147
|
+
<GridContainer
|
|
148
|
+
style={{
|
|
149
|
+
marginTop: 20,
|
|
150
|
+
paddingLeft: orientationState?.orientation === LANDSCAPE
|
|
151
|
+
? bottomSheetVisibility ? orientationState?.dimensions?.width * 0.004 :orientationState?.dimensions?.width * 0.008
|
|
152
|
+
: 0
|
|
153
|
+
}}
|
|
154
|
+
>
|
|
148
155
|
{categories[curIndexCateg].products.map((product) => (
|
|
149
156
|
<OCard
|
|
150
157
|
key={product.id}
|