diff --git a/src/App.js b/src/App.js index 39e4e31..53d200a 100644 --- a/src/App.js +++ b/src/App.js @@ -32,6 +32,7 @@ import AdminPanel from './view/admin'; import AddProduct from './view/addProduct'; import AddExam from './view/addExam'; import ChatPage from './view/chatPage'; +import ShoppingCart from './components/ShoppingCart'; let data = [ { @@ -702,6 +703,7 @@ function App() { } /> } /> } /> + } /> {/* diff --git a/src/components/ShoppingCart/index.js b/src/components/ShoppingCart/index.js index 08bf97a..77bc47d 100644 --- a/src/components/ShoppingCart/index.js +++ b/src/components/ShoppingCart/index.js @@ -219,7 +219,45 @@ function ShoppingCart({ // /> // // - return( + return(isMobile ? + + +
+
+ + {list.map((product, index) => ( + + ))} +
+ {/* {console.log(list)} */} + +
+ +
+
+

جمع مبالغ خدمات

+

{factorInfo?.sumPrice} تومان

+
+
+

تخفیف

+

{factorInfo?.offPrice} - تومان

+
+
+

کسر از اعتبار

+

-۰ تومان

+
+
+
+ +
+ + : +
diff --git a/src/components/header/Header.js b/src/components/header/Header.js index 084d5f8..937e7b4 100644 --- a/src/components/header/Header.js +++ b/src/components/header/Header.js @@ -1,5 +1,5 @@ import React from 'react'; -import { useLocation } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import './Header.scss'; import searchIcon from "../../assets/img/Group 1148.svg"; import moment from "jalali-moment"; @@ -11,7 +11,7 @@ import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; import arrowIcon from './MobileSideMenu/arrow-down.svg' import exitIcon from '../../assets/img/group-9.svg' - +import backIcon from './arrow-left-1.svg'; const Header = ({ isMobile, cart }) => { @@ -25,6 +25,7 @@ const Header = ({ const [menuPopup, setMenuPopup] = useState(false); const [subMenu, setSubMenu] = useState(false); const location = useLocation(); + const navigate = useNavigate(); return ( <> @@ -57,7 +58,13 @@ const Header = ({
- + { + location.pathname.includes('messages') ? ( +
navigate(-1)} className="w-8 h-8 bg-red-100 rounded-md flex items-center justify-center"> + +
+ ): ( +
{cart?.length}
@@ -69,6 +76,8 @@ const Header = ({
+ ) + }
: <> {location.pathname.includes('adminpanel') ?
: diff --git a/src/components/header/MobileSideMenu/index.js b/src/components/header/MobileSideMenu/index.js index d68b2c5..8162894 100644 --- a/src/components/header/MobileSideMenu/index.js +++ b/src/components/header/MobileSideMenu/index.js @@ -65,7 +65,7 @@ const MobileSideMenu = ({ icon: smsIcon, activeIcon: smsIconActive, title: 'پشتیبانی', - link: '' + link: '/messages' }, { icon: mapIcon, diff --git a/src/components/header/arrow-left-1.svg b/src/components/header/arrow-left-1.svg new file mode 100644 index 0000000..83727e8 --- /dev/null +++ b/src/components/header/arrow-left-1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/nav/Nav.js b/src/components/nav/Nav.js index f874733..03fe118 100644 --- a/src/components/nav/Nav.js +++ b/src/components/nav/Nav.js @@ -105,7 +105,7 @@ useEffect(() => { if (isMobile) { return ( - location2.pathname.includes('azmoon_list') || location2.pathname.includes('messages') ? null : + location2.pathname.includes('azmoon_list') || location2.pathname.includes('messages') || location2.pathname.includes('shoppingCart') ? null :
{ diff --git a/src/view/chatPage/index.js b/src/view/chatPage/index.js index 695a72a..e4b6980 100644 --- a/src/view/chatPage/index.js +++ b/src/view/chatPage/index.js @@ -1,18 +1,27 @@ -import React from "react"; +import React, { useEffect, useRef } from "react"; import sendIcon from "../../assets/img/vuesax-linear-direct-left.svg"; import avatar6 from "../../assets/img/avatar/sarah-brown-tTdC88_6a_I-unsplash.jpg"; import avatar5 from "../../assets/img/avatar/nicolas-horn-MTZTGvDsHFY-unsplash.jpg"; +import { BsCheck2All, BsTelephone, } from "react-icons/bs"; +import { connect } from "react-redux"; + const ChatPage = ({ messages, user, contact, + isMobile }) => { + const messagesEndRef = useRef(null) + + useEffect(() => { + messagesEndRef.current.scrollIntoView({behavior: 'smooth'}) + }, []) const textareaHanler=(e)=>{ e.target.style.height = `3rem`; let scHeight = e.target.scrollHeight; e.target.style.height = `${scHeight}px`; } - return( + return(isMobile &&
{contact.name} @@ -27,15 +36,15 @@ const ChatPage = ({
{ message.userId == user.id && - <> - - - - - - - - + + }

{message.sendTime}

@@ -44,7 +53,7 @@ const ChatPage = ({
)) } - +