In ProjectNav bar last selected tab will be shown when we refresh the page.
This commit is contained in:
parent
78a50f6db4
commit
ad10a5b66b
@ -47,9 +47,10 @@ const ProjectDetails = () => {
|
|||||||
refetch,
|
refetch,
|
||||||
} = useProjectDetails(projectId);
|
} = useProjectDetails(projectId);
|
||||||
|
|
||||||
const [activePill, setActivePill] = useState("profile");
|
// const [activePill, setActivePill] = useState("profile");
|
||||||
|
const [activePill, setActivePill] = useState(() => {
|
||||||
|
return localStorage.getItem("lastActiveProjectTab") || "profile";
|
||||||
|
});
|
||||||
|
|
||||||
const handler = useCallback(
|
const handler = useCallback(
|
||||||
(msg) => {
|
(msg) => {
|
||||||
@ -67,7 +68,9 @@ const ProjectDetails = () => {
|
|||||||
|
|
||||||
const handlePillClick = (pillKey) => {
|
const handlePillClick = (pillKey) => {
|
||||||
setActivePill(pillKey);
|
setActivePill(pillKey);
|
||||||
};
|
localStorage.setItem("lastActiveProjectTab", pillKey); // ✅ Save to localStorage
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const renderContent = () => {
|
const renderContent = () => {
|
||||||
if (projectLoading || !projects_Details) return <Loader />;
|
if (projectLoading || !projects_Details) return <Loader />;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user