From 3f60ab3b3c6b13f9a23756d81114f9b520f49577 Mon Sep 17 00:00:00 2001 From: Katiuska Alicea Date: Wed, 19 Jun 2024 17:03:12 -0700 Subject: [PATCH] Refactor AdminDashboard component to use Material-UI Typography for header --- .../src/components/admin/dashboard/index.js | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/client/src/components/admin/dashboard/index.js b/client/src/components/admin/dashboard/index.js index 461614e54..d09ecbf52 100644 --- a/client/src/components/admin/dashboard/index.js +++ b/client/src/components/admin/dashboard/index.js @@ -10,7 +10,8 @@ import Tab from '../../../common/tabs/tab'; import LocationTableReport from '../reports'; import '../../../sass/Dashboard.scss'; import './index.scss'; -import { REACT_APP_CUSTOM_REQUEST_HEADER as headerToSend} from '../../../utils/globalSettings'; +import { REACT_APP_CUSTOM_REQUEST_HEADER as headerToSend } from '../../../utils/globalSettings'; +import { Typography } from '@mui/material'; const AdminDashboard = () => { const { auth } = useAuth(); @@ -33,31 +34,23 @@ const AdminDashboard = () => { const [processedCheckins, setCheckins] = useState(null); // Volunteers SignedIn By Event Type - const [ - totalVolunteersByEventType, - setVolunteersSignedInByEventType, - ] = useState({}); - const [ - totalVolunteerHoursByEventType, - setVolunteeredHoursByEventType, - ] = useState({}); + const [totalVolunteersByEventType, setVolunteersSignedInByEventType] = + useState({}); + const [totalVolunteerHoursByEventType, setVolunteeredHoursByEventType] = + useState({}); const [totalVolunteerAvgHoursByEventType, setAvgHoursByEventType] = useState( {} ); // Volunteers SignedIn By HackNight Property - const [ - totalVolunteersByHackNightProp, - setVolunteersSignedInByHackNightProp, - ] = useState({}); + const [totalVolunteersByHackNightProp, setVolunteersSignedInByHackNightProp] = + useState({}); const [ totalVolunteerHoursByHackNightProp, setVolunteeredHoursByHackNightProp, ] = useState({}); - const [ - totalVolunteerAvgHoursByHackNightProp, - setAvgHoursByHackNightProp, - ] = useState({}); + const [totalVolunteerAvgHoursByHackNightProp, setAvgHoursByHackNightProp] = + useState({}); // Volunteers To Chart const [totalVolunteers, setVolunteersToChart] = useState({}); @@ -380,23 +373,25 @@ const AdminDashboard = () => { return function cleanup() { abortController.abort(); }; - // eslint-disable-next-line react-hooks/exhaustive-deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return auth && auth.user ? (
-

Stats by Location - Volunteer Hours

+ + Stats by Location - Volunteer Hours +
{!isLoading && nextEvent.length ? ( - !isCheckInReady && + !isCheckInReady && (
You have 1 upcoming event:
- ) : ( -
Current event:
) - } + ) : ( +
Current event:
+ )}
{isLoading ? (