From 5188db2c8f9d82131f12c3a91e44acf10c27dc19 Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Thu, 7 Aug 2025 14:39:55 +0530 Subject: [PATCH] handle condition if project haven't selected --- src/pages/Activities/AttendancePage.jsx | 50 +++++++++++++------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/src/pages/Activities/AttendancePage.jsx b/src/pages/Activities/AttendancePage.jsx index 65917c3f..d6a3463b 100644 --- a/src/pages/Activities/AttendancePage.jsx +++ b/src/pages/Activities/AttendancePage.jsx @@ -27,7 +27,7 @@ const AttendancePage = () => { const [ShowPending, setShowPending] = useState(false); const queryClient = useQueryClient(); const loginUser = getCachedProfileData(); - var selectedProject = useSelector((store) => store.localVariables.projectId); + const selectedProject = useSelector((store) => store.localVariables.projectId); const dispatch = useDispatch(); const [attendances, setAttendances] = useState(); @@ -155,28 +155,32 @@ const AttendancePage = () => { -
- {activeTab === "all" && ( -
- -
- )} - {activeTab === "logs" && ( -
- -
- )} - {activeTab === "regularization" && DoRegularized && ( -
- -
- )} -
+
+ {selectedProject ? ( + <> + {activeTab === "all" && ( +
+ +
+ )} + {activeTab === "logs" && ( +
+ +
+ )} + {activeTab === "regularization" && DoRegularized && ( +
+ +
+ )} + + ) : ( +
+ Please Select Project! +
+ )} +
+