diff --git a/Client/src/Pages/Infrastructure/index.jsx b/Client/src/Pages/Infrastructure/index.jsx index 46cf636d2..ff6e5a9a9 100644 --- a/Client/src/Pages/Infrastructure/index.jsx +++ b/Client/src/Pages/Infrastructure/index.jsx @@ -191,31 +191,26 @@ function Infrastructure() { ) : monitorState.monitors?.length !== 0 ? ( - - - {/* - This will be removed from here, but keeping the commented code to remind me to add a max width to the greeting component - - - */} - - + {isAdmin && ( + + )} + + { const theme = useTheme(); const dispatch = useDispatch(); @@ -20,6 +20,7 @@ const PageSpeed = ({ isAdmin }) => { const { user, authToken } = useSelector((state) => state.auth); const [isLoading, setIsLoading] = useState(true); const [monitors, setMonitors] = useState([]); + const [monitorCount, setMonitorCount] = useState(0); useEffect(() => { dispatch(getPageSpeedByTeamId(authToken)); }, [authToken, dispatch]); @@ -44,6 +45,7 @@ const PageSpeed = ({ isAdmin }) => { }); if (res?.data?.data?.monitors) { setMonitors(res.data.data.monitors); + setMonitorCount(res.data.data.monitorCount); } } catch (error) { console.log(error); @@ -53,7 +55,7 @@ const PageSpeed = ({ isAdmin }) => { }; fetchMonitors(); - }, []); + }, [authToken, user.teamId]); // will show skeletons only on initial load // since monitor state is being added to redux persist, there's no reason to display skeletons on every render @@ -76,8 +78,8 @@ const PageSpeed = ({ isAdmin }) => { {isActuallyLoading ? ( ) : monitors?.length !== 0 ? ( - - + + { )} + + PageSpeed monitors + {/* TODO Correct the class current-monitors-counter, there are some unnecessary things there */} + + {monitorCount} + + { /> ))} - + ) : (