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}
+ )
+ }
:
<>
{location.pathname.includes('adminpanel') ?
{
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 = ({
))
}
-
+