@@ -402,7 +406,7 @@ function ActiveJobsMedia(props) {
{/* TEXTAREA SECTION */}
-
+
{tab == "message" ? (
) : (
-
-
+
+
)
}
diff --git a/src/components/Partials/Layout.jsx b/src/components/Partials/Layout.jsx
index 5432e35..f9f58e6 100644
--- a/src/components/Partials/Layout.jsx
+++ b/src/components/Partials/Layout.jsx
@@ -77,11 +77,10 @@ export default function Layout({ children }) {
{children && children}
- {userDetails.account_type == 'FULL' &&
+
- }
@@ -113,14 +112,14 @@ export default function Layout({ children }) {
Are you sure you want to Logout of your WrenchBoard account?
-
-
-
-
+
+
+
+
diff --git a/src/components/Partials/MediaHeader.jsx b/src/components/Partials/MediaHeader.jsx
new file mode 100644
index 0000000..b3ac67f
--- /dev/null
+++ b/src/components/Partials/MediaHeader.jsx
@@ -0,0 +1,621 @@
+import React, { useContext } from "react";
+import { Link, useLocation, useNavigate } from "react-router-dom";
+import bank1 from "../../assets/images/bank-1.png";
+import bank2 from "../../assets/images/bank-2.png";
+import bank3 from "../../assets/images/bank-3.png";
+import bank4 from "../../assets/images/bank-4.png";
+import profileImg from "../../assets/images/profile.jpg";
+import useToggle from "../../hooks/useToggle";
+import DarkModeContext from "../Contexts/DarkModeContext";
+import Icons from "../Helpers/Icons";
+import ModalCom from "../Helpers/ModalCom";
+import WalletHeader from "../MyWallet/WalletHeader";
+
+import { useSelector } from "react-redux";
+import Flag from "../../assets/images/united-states.svg";
+import siteLogo from "../../assets/images/wrenchboard-logo-text.png";
+// import { updateWalletDetails } from "../../store/walletDetails";
+import TimeDifference from "../Helpers/TimeDifference";
+
+const DEFAULT_PROFILE_IMAGE = require("../../assets/images/profile.jpg");
+
+export default function MediaHeader({ logoutModalHandler, sidebarHandler, backpath, state, title }) {
+
+ const darkMode = useContext(DarkModeContext);
+
+ const navigate = useNavigate()
+
+ const {userDetails: { account_type }} = useSelector((state) => state?.userDetails);
+
+ const [balanceDropdown, setbalanceValue] = useToggle(false);
+ const [notificationDropdown, setNotificationValue] = useToggle(false);
+ const [userProfileDropdown, setProfileDropdown] = useToggle(false);
+ const [moneyPopup, setPopup] = useToggle(false);
+
+ const { userDetails } = useSelector((state) => state?.userDetails);
+
+ const { notifications } = useSelector((state) => state?.notifications); // NOTIFICATION STORE
+ const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
+
+ const image = localStorage.getItem("session_token")
+ ? userDetails.account_type === "FAMILY"
+ ? `${userDetails.session_image_server}${localStorage.getItem(
+ "session_token"
+ )}/family/${sessionStorage.getItem("family_uid")}`
+ : `${userDetails.session_image_server}${localStorage.getItem(
+ "session_token"
+ )}/profile/${userDetails.uid}`
+ : "";
+
+ // 9308RDR122
+
+ const handlerBalance = () => {
+ setbalanceValue.toggle();
+ if (notificationDropdown) {
+ setNotificationValue.toggle();
+ }
+ if (userProfileDropdown) {
+ setProfileDropdown.toggle();
+ }
+ };
+ const handlerNotification = () => {
+ setNotificationValue.toggle();
+ if (balanceDropdown) {
+ setbalanceValue.toggle();
+ }
+ if (userProfileDropdown) {
+ setProfileDropdown.toggle();
+ }
+ };
+ const handlerProfile = () => {
+ setProfileDropdown.toggle();
+ if (balanceDropdown) {
+ setbalanceValue.toggle();
+ }
+ if (notificationDropdown) {
+ setNotificationValue.toggle();
+ }
+ };
+ const clickAwayhandler = () => {
+ if (balanceDropdown) {
+ setbalanceValue.toggle();
+ }
+ if (notificationDropdown) {
+ setNotificationValue.toggle();
+ }
+ if (userProfileDropdown) {
+ setProfileDropdown.toggle();
+ }
+ };
+ const addMoneyHandler = () => {
+ setPopup.toggle();
+ setbalanceValue.set(false);
+ };
+
+ // getting the location of head
+ let { pathname } = useLocation();
+
+ const handleWalletBtn = () => {
+ if (pathname === "/my-wallet") {
+ setbalanceValue.set(false);
+ } else return balanceDropdown;
+ };
+
+ // User Profile
+ let { firstname, lastname, email, profile_pic_url } = userDetails;
+ let userEmail = email?.split("@")[0];
+ const userProfileImage = image || DEFAULT_PROFILE_IMAGE;
+
+ return (
+ <>
+
+
+
+
+
+ {/* Home */}
+
+
+
+ {/* Back BTN AND TITLE */}
+ {/*
+
+
+
+ {darkMode.theme === "light" ? (
+

+ ) : (
+

+ )}
+
+
+
+ {title && title}
+
+
*/}
+
+
+ {/* user info */}
+
+ {/* dark mode */}
+ {/*
*/}
+ {/* balance */}
+
+ {/* My Page Button */}
+ {/* {userDetails.account_type === "FULL" ?
: null} */}
+
+ {/*
*/}
+
+ {/* notification */}
+
+
handlerNotification()}
+ className="lg:w-[48px] lg:h-[48px] w-[38px] h-[38px] bg-white flex justify-center items-center rounded-full overflow-hidden relative"
+ >
+
+
+ {notifications?.loading ? "●" : notifications?.data?.length}
+
+
+
+
+
+ Recent Notifications
+
+
+
+
+
+ {notifications?.data?.length &&
+ notifications?.data?.map((item, idx) => {
+ if (idx < 5) {
+ return (
+ -
+
+
+
})
+
+
+
+ {item?.title}
+ {/*
+ successfully done
+ */}
+
+
+
+
+
+
+
+ );
+ }
+ })}
+
+
+
+
+ See all Notification
+
+ {/* */}
+
+
+
+
+
+
+
+
+ 10
+
+
+
+ {/* profile */}
+
+
handlerProfile()}
+ className="hidden lg:flex items-center space-x-3.5"
+ >
+ {/* profile-image */}
+
+

+
+
+
+ {firstname}
+
+ {userDetails && userDetails?.account_type !== "FAMILY" && (
+
@{userEmail}
+ )}
+
+
+
+
+
handlerProfile()}
+ className="lg:w-[62px] lg:h-[62px] w-[50px] h-[50px] rounded-full overflow-hidden block"
+ >
+

+
+
+
+
+
+

+
+
+
+ {`${firstname} ${lastname}`}
+
+
+
+
+ {userDetails && userDetails?.account_type !== "FAMILY" && (
+ -
+
+
+
+
+ )}
+ -
+
+
+
+
+ {userDetails && userDetails?.account_type !== "FAMILY" && (
+ -
+
+
+
+
+ )}
+ {userDetails && userDetails?.account_type !== "FAMILY" && (
+ <>
+ -
+
+
+
+
+ >
+ )}
+
+
+
+ {userDetails && userDetails?.account_type !== "FAMILY" && (
+ <>
+ -
+
+
+
+
Language
+
+
English
+

+
+
+
+
+ {/* langauge list items*/}
+
+
+ -
+
+
+
+

+
English
+
+
+
+
+
+
+ {/* end Language list items*/}
+
+ -
+
+
+
+
+ >
+ )}
+
+ -
+
+
+ {process.env.REACT_APP_LOGOUT_TEXT}
+
+
+
+
+
+
+
+
+
+
+
+ {balanceDropdown || notificationDropdown || userProfileDropdown ? (
+
+ ) : (
+ ""
+ )}
+ >
+ );
+}
+
+const PageButton = () => {
+ return (
+
+
+
+
+
+
My Page
+
+ {/* */}
+
+
+
+ );
+};
+
+const HomeButton = () => {
+ return (
+
+
+
+ );
+};
diff --git a/src/components/Partials/MediaLayout.jsx b/src/components/Partials/MediaLayout.jsx
index c821553..f76d824 100644
--- a/src/components/Partials/MediaLayout.jsx
+++ b/src/components/Partials/MediaLayout.jsx
@@ -4,12 +4,13 @@ import { useNavigate } from "react-router-dom";
import useToggle from "../../hooks/useToggle";
import { drawerToggle } from "../../store/drawer";
import ModalCom from "../Helpers/ModalCom";
-import Header from "./Header";
+// import Header from "./Header";
import MobileSidebar from "./MobileSideBar";
import RightSideBar from "./RightSideBar";
import Sidebar from "./Sidebar";
+import MediaHeader from "./MediaHeader";
-export default function MediaLayout({ children }) {
+export default function MediaLayout({backpath, title, state, children }) {
const { drawer } = useSelector((state) => state.drawer);
const { userJobList } = useSelector((state) => state.userJobList);
const dispatch = useDispatch();
@@ -68,7 +69,7 @@ export default function MediaLayout({ children }) {
{/* header */}
- setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
+ setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
{/* container */}
@@ -109,14 +110,14 @@ export default function MediaLayout({ children }) {
Are you sure you want to Logout of your WrenchBoard account?
-
-
-
-
+
+
+
+