Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AdminDashboard component to use Material-UI Typography for h… #1677

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions client/src/components/admin/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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({});
Expand Down Expand Up @@ -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 ? (
<div className="flex-container">
<div className="dashboard admin-dashboard-wrap">
<div className="admin-header">
<h1>Stats by Location - Volunteer Hours</h1>
<Typography variant="h1" component="h1">
Stats by Location - Volunteer Hours
</Typography>
</div>

{!isLoading && nextEvent.length ? (
!isCheckInReady &&
!isCheckInReady && (
<div className="event-header">You have 1 upcoming event:</div>
) : (
<div className="event-header">Current event:</div>
)
}
) : (
<div className="event-header">Current event:</div>
)}

<div className="admin-upcoming-event">
{isLoading ? (
Expand Down
Loading