Compare commits
No commits in common. "4b0ea3a0dbf2c19a51fdce807b6a7414ffcadce8" and "4ad87af7f40f95a55b406a9d763b158b7a1e3442" have entirely different histories.
4b0ea3a0db
...
4ad87af7f4
@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { useSearchParams, useParams, useNavigate } from "react-router-dom";
|
import { useSearchParams, useParams, useNavigate } from "react-router-dom";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useEmployee,
|
useEmployee,
|
||||||
@ -23,33 +23,22 @@ import EmpBanner from "../../components/Employee/EmpBanner";
|
|||||||
import EmpDashboard from "../../components/Employee/EmpDashboard";
|
import EmpDashboard from "../../components/Employee/EmpDashboard";
|
||||||
import EmpDocuments from "../../components/Employee/EmpDocuments";
|
import EmpDocuments from "../../components/Employee/EmpDocuments";
|
||||||
import EmpActivities from "../../components/Employee/EmpActivities";
|
import EmpActivities from "../../components/Employee/EmpActivities";
|
||||||
import { setProjectId } from "../../slices/localVariablesSlice";
|
|
||||||
|
|
||||||
const EmployeeProfile = () => {
|
const EmployeeProfile = () => {
|
||||||
const { profile } = useProfile();
|
const { profile } = useProfile();
|
||||||
|
|
||||||
const projectID = useSelector((store) => store.localVariables.projectId);
|
const projectID = useSelector((store) => store.localVariables.projectId);
|
||||||
|
|
||||||
const { employeeId } = useParams();
|
const { employeeId } = useParams();
|
||||||
const dispatch = useDispatch();
|
|
||||||
|
|
||||||
const [SearchParams] = useSearchParams();
|
const [SearchParams] = useSearchParams();
|
||||||
const tab = SearchParams.get("for");
|
const tab = SearchParams.get("for");
|
||||||
const [activePill, setActivePill] = useState(tab || "profile");
|
const [activePill, setActivePill] = useState(tab || "profile");
|
||||||
const [showModal, setShowModal] = useState(false);
|
const [showModal, setShowModal] = useState(false);
|
||||||
const {
|
const {data:currentEmployee,isLoading,isError,error} = useEmployee(employeeId)
|
||||||
data: currentEmployee,
|
|
||||||
isLoading,
|
|
||||||
isError,
|
|
||||||
error,
|
|
||||||
} = useEmployee(employeeId);
|
|
||||||
const handlePillClick = (pillKey) => {
|
const handlePillClick = (pillKey) => {
|
||||||
setActivePill(pillKey);
|
setActivePill(pillKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
dispatch(setProjectId(null));
|
|
||||||
}, [projectID]);
|
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const renderContent = () => {
|
const renderContent = () => {
|
||||||
@ -98,7 +87,7 @@ const EmployeeProfile = () => {
|
|||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <div>Loading...</div>;
|
return <div>Loading...</div>;
|
||||||
}
|
}
|
||||||
if (isError) return <div>{error.message}</div>;
|
if(isError) return <div >{error.message}</div>
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user