diff --git a/enatega-multivendor-app/src/apollo/queries.js b/enatega-multivendor-app/src/apollo/queries.js index ec415a50..74ded0b8 100644 --- a/enatega-multivendor-app/src/apollo/queries.js +++ b/enatega-multivendor-app/src/apollo/queries.js @@ -741,6 +741,8 @@ export const FavouriteRestaurant = `query UserFavourite ($latitude:Float,$longit orderId orderPrefix name + reviewCount + reviewAverage image address location{coordinates} diff --git a/enatega-multivendor-app/src/components/Main/ActiveOrders/ActiveOrders.js b/enatega-multivendor-app/src/components/Main/ActiveOrders/ActiveOrders.js index 5e21ce56..755e2cd0 100644 --- a/enatega-multivendor-app/src/components/Main/ActiveOrders/ActiveOrders.js +++ b/enatega-multivendor-app/src/components/Main/ActiveOrders/ActiveOrders.js @@ -28,16 +28,21 @@ const ActiveOrders = ({ onActiveOrdersChange }) => { const navigation = useNavigation() const themeContext = useContext(ThemeContext) const currentTheme = theme[themeContext.ThemeValue] - const activeOrders = orders.filter(o => + const activeOrders = orders.filter((o) => orderStatusActive.includes(o.orderStatus) ) - const onPressDetails = order => { + + const onPressDetails = (order) => { navigation.navigate('OrderDetail', { _id: order._id, currencySymbol: configuration.currencySymbol }) } + const navToActiveOrders = () => { + navigation.navigate('MyOrders') + } + const [showAll, setShowAll] = useState(false) const displayOrders = showAll ? activeOrders : activeOrders.slice(0, 2) @@ -53,18 +58,27 @@ const ActiveOrders = ({ onActiveOrdersChange }) => { const order = displayOrders[0] const remainingTime = calulateRemainingTime(order) const modalStyle = { - borderWidth: StyleSheet.hairlineWidth, - backgroundColor: currentTheme.themeBackground, - - }; + borderWidth: StyleSheet.hairlineWidth, + backgroundColor: currentTheme.themeBackground + } return ( - + - {t('estimatedDeliveryTime')} + + {t('estimatedDeliveryTime')} + + onPressDetails(order)}> - {t('details')} + + {t('details')}{' '} + @@ -82,14 +96,44 @@ const ActiveOrders = ({ onActiveOrdersChange }) => { + style={styles(currentTheme).statusText} + > {t(checkStatus(order.orderStatus).statusText)} + + + { activeOrders.length > 1 ? + ( + navToActiveOrders()}> + + {t('ActiveOrders')} + + + + + {activeOrders.length} + + + + ) : '' + } + - ) } diff --git a/enatega-multivendor-app/src/components/Main/ActiveOrders/styles.js b/enatega-multivendor-app/src/components/Main/ActiveOrders/styles.js index 7b1ad4e6..5e969f6b 100644 --- a/enatega-multivendor-app/src/components/Main/ActiveOrders/styles.js +++ b/enatega-multivendor-app/src/components/Main/ActiveOrders/styles.js @@ -115,7 +115,20 @@ const styles = (props = null) => marginTop: scale(2), marginBottom: scale(2), paddingLeft: scale(40) - } + }, + absoluteContainer: { + width: verticalScale(20), + height: verticalScale(20), + backgroundColor: '#90E36D', + justifyContent: 'center', + alignItems: 'center', + borderRadius: scale(15), + position: 'absolute', + padding:3, + right: scale(-25), + bottom: scale(2) + }, + }) export default styles diff --git a/enatega-multivendor-app/src/components/Main/Item/Item.js b/enatega-multivendor-app/src/components/Main/Item/Item.js index 1f4041fd..5abbcdea 100644 --- a/enatega-multivendor-app/src/components/Main/Item/Item.js +++ b/enatega-multivendor-app/src/components/Main/Item/Item.js @@ -204,7 +204,7 @@ function Item(props) { numberOfLines={1} bold Normal> - {configuration.currencySymbol + '' + item.minimumOrder}{' '} + {configuration.currencySymbol + ' ' + item.tax}{' '} diff --git a/enatega-multivendor-app/src/components/Main/RestaurantCard/NewRestaurantCard.js b/enatega-multivendor-app/src/components/Main/RestaurantCard/NewRestaurantCard.js index 94d9f6c8..073c25b6 100644 --- a/enatega-multivendor-app/src/components/Main/RestaurantCard/NewRestaurantCard.js +++ b/enatega-multivendor-app/src/components/Main/RestaurantCard/NewRestaurantCard.js @@ -155,7 +155,7 @@ function NewRestaurantCard(props) { numberOfLines={1} bold Normal> - ${props.tax} + {configuration.currencySymbol + ' ' + props.tax}{' '} diff --git a/enatega-multivendor-app/src/components/Restaurant/ImageHeader/ImageHeader.js b/enatega-multivendor-app/src/components/Restaurant/ImageHeader/ImageHeader.js index cd934922..03b66ccf 100644 --- a/enatega-multivendor-app/src/components/Restaurant/ImageHeader/ImageHeader.js +++ b/enatega-multivendor-app/src/components/Restaurant/ImageHeader/ImageHeader.js @@ -404,7 +404,7 @@ function ImageTextCenterHeader(props, ref) { style={styles().restaurantAbout} textColor={currentTheme.fontMainColor} > - {configuration.currencySymbol}{' '}{aboutObject.restaurantTax} {t('deliveryCharges')} + {configuration.currencySymbol}{' '}{aboutObject.restaurantTax} {t('taxFee')} - {address.deliveryAddress} + {address.deliveryAddress} diff --git a/enatega-multivendor-app/src/screens/Menu/Menu.js b/enatega-multivendor-app/src/screens/Menu/Menu.js index a2279c58..829e14dc 100644 --- a/enatega-multivendor-app/src/screens/Menu/Menu.js +++ b/enatega-multivendor-app/src/screens/Menu/Menu.js @@ -116,6 +116,7 @@ function Menu({ route, props }) { ip: null }, onCompleted: data => { + setRestaurantData(data.nearByRestaurantsPreview.restaurants) setSectionData(data.nearByRestaurantsPreview.sections) }, @@ -413,10 +414,12 @@ function Menu({ route, props }) { if (ratings?.selected?.length > 0) { const numericRatings = ratings.selected?.map(extractRating) filteredData = filteredData.filter( - item => item?.reviewData?.ratings >= Math.min(...numericRatings) + item => item?.reviewAverage >= Math.min(...numericRatings) ) } + + // Sort filter if (sort?.selected?.length > 0) { if (sort.selected[0] === 'Fast Delivery') { diff --git a/enatega-multivendor-app/src/screens/OrderDetail/OrderDetail.js b/enatega-multivendor-app/src/screens/OrderDetail/OrderDetail.js index 62937cdc..427e0828 100644 --- a/enatega-multivendor-app/src/screens/OrderDetail/OrderDetail.js +++ b/enatega-multivendor-app/src/screens/OrderDetail/OrderDetail.js @@ -59,8 +59,16 @@ function OrderDetail(props) { const headerRef = useRef(false) const { GOOGLE_MAPS_KEY } = useEnvVars() const mapView = useRef(null) + const [cancelOrder, { loading: loadingCancel }] = useMutation(CANCEL_ORDER, { onError, + onCompleted:(data)=> + { + if(data.abortOrder.orderStatus === 'CANCELLED') + { + navigation.navigate("Main") + } + }, variables: { abortOrderId: id } }) @@ -77,6 +85,7 @@ function OrderDetail(props) { setCancelModalVisible(!cancelModalVisible) } function onError(error) { + FlashMessage({ message: error.message }) diff --git a/enatega-multivendor-app/translations/ar.js b/enatega-multivendor-app/translations/ar.js index d4c467f0..07412b2c 100644 --- a/enatega-multivendor-app/translations/ar.js +++ b/enatega-multivendor-app/translations/ar.js @@ -542,5 +542,6 @@ export const ar = { pickupTime: 'وقت الاستلام', asap: 'فورًا', selectOptionforAddon: 'يرجى اختيار خيار للوظيفة الإضافية', - whatsAppText: 'تحتاج مساعدة أكثر؟ اتصل بنا' + whatsAppText: 'تحتاج مساعدة أكثر؟ اتصل بنا', + ActiveOrders:"الطلبات النشطة", } diff --git a/enatega-multivendor-app/translations/de.js b/enatega-multivendor-app/translations/de.js index 4edd5a78..332ddbde 100644 --- a/enatega-multivendor-app/translations/de.js +++ b/enatega-multivendor-app/translations/de.js @@ -559,5 +559,6 @@ export const de = { pickupTime: 'Ophaaltijd', asap: 'Zo snel mogelijk', selectOptionforAddon: 'Bitte wählen Sie eine Option für das Add-On aus', - whatsAppText: 'Benötigen Sie weitere Hilfe? Kontaktieren Sie uns' + whatsAppText: 'Benötigen Sie weitere Hilfe? Kontaktieren Sie uns', + ActiveOrders:"Aktive Bestellungen", } diff --git a/enatega-multivendor-app/translations/en.js b/enatega-multivendor-app/translations/en.js index 4b14960e..4d982a31 100644 --- a/enatega-multivendor-app/translations/en.js +++ b/enatega-multivendor-app/translations/en.js @@ -552,5 +552,6 @@ export const en = { salesTax: 'Sales Tax', minimumOrder: 'Minimum Order', selectOptionforAddon: 'Please select an option for addon', - whatsAppText: 'Need more help? Contact us' + whatsAppText: 'Need more help? Contact us', + ActiveOrders:"Active Orders", } diff --git a/enatega-multivendor-app/translations/fr.js b/enatega-multivendor-app/translations/fr.js index b98f1598..a5720ed5 100644 --- a/enatega-multivendor-app/translations/fr.js +++ b/enatega-multivendor-app/translations/fr.js @@ -556,5 +556,6 @@ export const fr = { pickupTime: 'Heure de ramassage', asap: 'Dès que possible', selectOptionforAddon: "Veuillez sélectionner une option pour l'addon", - whatsAppText: "Besoin de plus d'aide? Contactez-nous" + whatsAppText: "Besoin de plus d'aide? Contactez-nous", + ActiveOrders:"Commandes actives", } diff --git a/enatega-multivendor-app/translations/he.js b/enatega-multivendor-app/translations/he.js index ca8cd184..cbc1aefb 100644 --- a/enatega-multivendor-app/translations/he.js +++ b/enatega-multivendor-app/translations/he.js @@ -528,5 +528,6 @@ export const he = { pickupTime: 'זמן איסוף', asap: 'בהקדם האפשרי', selectOptionforAddon: 'בבקשה בחר אפשרות עבור התוסף', - whatsAppText: 'צריך עזרה נוספת? צור קשר' + whatsAppText: 'צריך עזרה נוספת? צור קשר', + ActiveOrders:"הזמנות פעילות", } diff --git a/enatega-multivendor-app/translations/km.js b/enatega-multivendor-app/translations/km.js index 65d79e4e..4d64bb55 100644 --- a/enatega-multivendor-app/translations/km.js +++ b/enatega-multivendor-app/translations/km.js @@ -540,5 +540,6 @@ export const km = { pickupTime: 'ពេលវេលា​យកឡើង', asap: 'ដោយសារយោង', selectOptionforAddon: 'សូមជ្រើសរើស​ជម្រើសសម្រាប់​គ្រឿង​បន្ថែម', - whatsAppText: 'ត្រូវការជំនួយច្រើនទៀត? ទាក់ទង​មកយើង' + whatsAppText: 'ត្រូវការជំនួយច្រើនទៀត? ទាក់ទង​មកយើង', + ActiveOrders:"បញ្ជាទិញសកម្ម", } diff --git a/enatega-multivendor-app/translations/zh.js b/enatega-multivendor-app/translations/zh.js index ecd54337..7c5b8e67 100644 --- a/enatega-multivendor-app/translations/zh.js +++ b/enatega-multivendor-app/translations/zh.js @@ -526,5 +526,6 @@ export const zh = { pickupTime: '取货时间', asap: '尽快', selectOptionforAddon: '请为附加组件选择一个选项', - whatsAppText: '需要更多帮助?联系我们' + whatsAppText: '需要更多帮助?联系我们', + ActiveOrders: "活动订单", } diff --git a/enatega-multivendor-rider/src/screens/ChatWithCustomer/ChatScreen.js b/enatega-multivendor-rider/src/screens/ChatWithCustomer/ChatScreen.js index 6c2edbf1..3e9000d5 100644 --- a/enatega-multivendor-rider/src/screens/ChatWithCustomer/ChatScreen.js +++ b/enatega-multivendor-rider/src/screens/ChatWithCustomer/ChatScreen.js @@ -7,8 +7,9 @@ import { Ionicons, Entypo } from '@expo/vector-icons' import TextDefault from '../../components/Text/TextDefault/TextDefault' import styles from './styles' import colors from '../../utilities/colors' +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context' -import {useTranslation} from 'react-i18next' +import { useTranslation } from 'react-i18next' const ChatScreen = ({ navigation, route }) => { const { @@ -21,7 +22,7 @@ const ChatScreen = ({ navigation, route }) => { profile } = useChatScreen({ navigation, route }) - const {t} = useTranslation() + const { t } = useTranslation() const filterImages = src => { setImage(image.filter(item => item !== src)) } @@ -101,29 +102,33 @@ const ChatScreen = ({ navigation, route }) => { } return ( - 0 ? renderAccessory : null} - text={inputMessage} - onInputTextChanged={m => setInputMessage(m)} - /> + + + 0 ? renderAccessory : null} + text={inputMessage} + onInputTextChanged={m => setInputMessage(m)} + /> + + ) } diff --git a/enatega-multivendor-rider/src/screens/ChatWithCustomer/styles.js b/enatega-multivendor-rider/src/screens/ChatWithCustomer/styles.js index 46d210f8..6da03959 100644 --- a/enatega-multivendor-rider/src/screens/ChatWithCustomer/styles.js +++ b/enatega-multivendor-rider/src/screens/ChatWithCustomer/styles.js @@ -22,8 +22,8 @@ export default StyleSheet.create({ sendIcon: { marginBottom: 7, marginRight: 10 }, emptyChat: { marginTop: 300, - transform: [{ scaleY: -1 }, {scaleX: -1}], - alignSelf:'center' + transform: [{ scaleY: -1 }], + alignSelf: 'center' }, bubbleRight: { backgroundColor: colors.black,