From caaff883f1c7f5d96421c1d135f70e5ebb6f8d4b Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 30 Mar 2024 13:19:38 -0400 Subject: [PATCH] added new page for media --- .env | 1 + .env.development | 1 + .env.production | 1 + .../MyActiveJobs/ActiveJobsMedia.jsx | 5 +- src/components/Partials/MediaLayout.jsx | 126 ++++++++++++++++++ 5 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 src/components/Partials/MediaLayout.jsx diff --git a/.env b/.env index 405a541..949303d 100644 --- a/.env +++ b/.env @@ -14,6 +14,7 @@ REACT_APP_APPSITE="https://myfitapp.mermsemr.com" REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1" REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1" +REACT_APP_ENDPOINT_KEY="WRENCH-BOARD-2024" #SOCKETS ENDS REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com" diff --git a/.env.development b/.env.development index 3598525..3e1b1be 100644 --- a/.env.development +++ b/.env.development @@ -14,6 +14,7 @@ REACT_APP_APPSITE="https://myfitapp.mermsemr.com" REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1" REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1" +REACT_APP_ENDPOINT_KEY="WRENCH-BOARD-2024" #SOCKETS ENDS REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com" diff --git a/.env.production b/.env.production index 851b7a1..615202b 100644 --- a/.env.production +++ b/.env.production @@ -14,6 +14,7 @@ REACT_APP_APPSITE="https://myfitapp.mermsemr.com" REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1" REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1" +REACT_APP_ENDPOINT_KEY="WRENCH-BOARD-2024" #SOCKETS ENDS REACT_APP_PRIMARY_SOCKET="https://socket.wrenchboard.com" diff --git a/src/components/MyActiveJobs/ActiveJobsMedia.jsx b/src/components/MyActiveJobs/ActiveJobsMedia.jsx index d894e64..58bf969 100644 --- a/src/components/MyActiveJobs/ActiveJobsMedia.jsx +++ b/src/components/MyActiveJobs/ActiveJobsMedia.jsx @@ -8,6 +8,7 @@ import Layout from "../Partials/Layout"; import LoadingSpinner from "../Spinners/LoadingSpinner"; import ActiveJobMessageMedia from "./ActiveJobMessageMedia"; import IndexJobActions from "./JobActions/IndexJobActions"; +import MediaLayout from "../Partials/MediaLayout"; const VideoElement = lazy(() => import("../VideoCom/VideoElement")); @@ -270,7 +271,7 @@ function ActiveJobsMedia(props) { },[props.details.contract, props.details.contract_uid]) return ( - +
{/* job title */}
@@ -582,7 +583,7 @@ function ActiveJobsMedia(props) { /> )} {/* END OF POPOUT SECTION */} - + ); } diff --git a/src/components/Partials/MediaLayout.jsx b/src/components/Partials/MediaLayout.jsx new file mode 100644 index 0000000..bedb254 --- /dev/null +++ b/src/components/Partials/MediaLayout.jsx @@ -0,0 +1,126 @@ +import React, { useState } from "react"; +import { useDispatch, useSelector } from "react-redux"; +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 MobileSidebar from "./MobileSideBar"; +import RightSideBar from "./RightSideBar"; +import Sidebar from "./Sidebar"; + +export default function MediaLayout({ children }) { + const { drawer } = useSelector((state) => state.drawer); + const { userJobList } = useSelector((state) => state.userJobList); + const dispatch = useDispatch(); + const [MobileSideBar, setMobileSidebar] = useToggle(false); + const [logoutModal, setLogoutModal] = useState(false); + const logoutModalHandler = () => { + setLogoutModal(!logoutModal); + }; + const navigate = useNavigate(); + const logOut = () => { + sessionStorage.clear(); + localStorage.clear(); + // toast.success("Come Back Soon", { + // icon: `🙂`, + // }); + + navigate("/login", { replace: true }); + }; + + //--------------------------------------- + /* LET U DEAL WITH JOB LIST - we need to centralize this list */ + // const {jobListTable} = useSelector((state) => state.tableReload) + // const [myJobList, setMyJobList] = useState({loading: true, data:[]}); + // const api = new usersService(); + + // const getMyJobList = async () => { + // setMyJobList({loading: true, data:[]}) + // try { + // const res = await api.getMyJobList(); + // setMyJobList({loading: false, data:res.data}) + // // setMyJobList(res.data); + // } catch (error) { + // setMyJobList({loading: false, data:[]}) + // console.log("Error getting mode"); + // } + // }; + // useEffect(() => { + // getMyJobList(); + // }, [jobListTable]); + + return ( + <> +
+
+ {/* sidebar */} + {/**/} + {/*{MobileSideBar && (*/} + {/*
setMobileSidebar.toggle()} className="bg-black bg-opacity-20 fixed left-0 top-0 w-full h-full z-[50] block xl:hidden">
*/} + {/*)}*/} + {/*
*/} + {/* setMobileSidebar.toggle()} myJobList={userJobList} />*/} + {/*
*/} + {/* end sidebar */} +
+ {/* header */} +
+
setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} /> +
+ {/* container */} +
+
+ {children && children} +
+ {/*
*/} + {/* */} + {/*
*/} +
+
+
+
+ {logoutModal && ( + +
+
+

+ Confirm +

+ +
+
+
+ + + + + +
+
+

+ Are you sure you want to Logout of your WrenchBoard account? +

+
+
+ + +
+
+
+
+ )} + + ); +}