-
+
-
+
{first_name} {last_name}
diff --git a/src/pages/AdminPage.jsx b/src/pages/AdminPage.jsx
index 037f331..be2149a 100644
--- a/src/pages/AdminPage.jsx
+++ b/src/pages/AdminPage.jsx
@@ -96,7 +96,7 @@ export default function AdminPage() {
return (
-
+
Administrators
-
-
- {isOpen && (
-
- )}
-
-
+ {/* Drawer Component */}
+ {breakpoint == 'base' ? (
+
+ ) : (
+ isOpen && (
+
+ )
+ )}
);
};
-
export default VolunteerEventPage;
diff --git a/src/pages/VolunteerHomePage.jsx b/src/pages/VolunteerHomePage.jsx
index fd2425a..cf6d8a4 100644
--- a/src/pages/VolunteerHomePage.jsx
+++ b/src/pages/VolunteerHomePage.jsx
@@ -208,19 +208,20 @@ const VolunteerHomePage = () => {
-
-
+
+
{eventCards}
-
-
+
+
diff --git a/src/pages/Volunteers.jsx b/src/pages/Volunteers.jsx
index bd48425..4c15277 100644
--- a/src/pages/Volunteers.jsx
+++ b/src/pages/Volunteers.jsx
@@ -19,6 +19,7 @@ import Fuse from 'fuse.js';
import { TrophyIcon } from '../components/Icons/TrophyIcon';
import NavbarContext from '../utils/NavbarContext';
import { MdPeopleAlt } from 'react-icons/md';
+import { CSVLink } from 'react-csv';
const Volunteers = () => {
const [registered, setRegistered] = useState('');
@@ -27,8 +28,19 @@ const Volunteers = () => {
const [volunteers, setVolunteers] = useState([]);
const [displayedVolunteers, setDisplayedVolunteers] = useState([]);
const [input, setInput] = useState('');
+ const [volunteerData, setVolunteerData] = useState([]);
const { onNavbarDrawerOpen } = useContext(NavbarContext);
+ const header = [
+ { key: 'name', label: 'NAME' },
+ { key: 'email', label: 'EMAIL' },
+ { key: 'phone_number', label: 'PHONE_NUMBER' },
+ { key: 'organization', label: 'ORGANIZATION' },
+ { key: 'about_me', label: 'ABOUT_ME' },
+ { key: 'total_trash', label: 'TOTAL_TRASH' },
+ { key: 'events_attended', label: 'EVENTS_ATTENDED' },
+ ];
+
const setData = async () => {
try {
const res = await Backend.get('/stats/registered');
@@ -69,6 +81,19 @@ const Volunteers = () => {
}
}, [input, volunteers]);
+ useEffect(() => {
+ const getVolunteerData = async () => {
+ try {
+ const volunteerData = await Backend.get(`/stats/export/volunteers`);
+ setVolunteerData(volunteerData.data);
+ } catch (err) {
+ console.log(err.message);
+ }
+ };
+
+ getVolunteerData();
+ }, []);
+
return (
<>
{/* Registered + Checked-In */}
@@ -162,44 +187,65 @@ const Volunteers = () => {
bg="#D4E4F9"
padding="3"
fontSize="lg"
- display="flex"
- justifyContent="space-between"
+ justify="space-between"
alignItems="center"
w="100%"
borderRadius={'4.541px'}
+ maxWidth={{ base: '300px', md: '300px', lg: '300px', xl: '300px' }}
>
-
-
-
+
+
+
{topThree[0] && topThree[0].volunteer_first_name}{' '}
{topThree[0] && topThree[0].volunteer_last_name}{' '}
-
+
+
{/* */}
{topThree[0] && truncate(topThree[0].total_weight, 2)} lbs
-
+
2
-
- {topThree[1] && topThree[1].volunteer_first_name}{' '}
- {topThree[1] && topThree[1].volunteer_last_name}{' '}
+
+
+ {topThree[1] && topThree[1].volunteer_first_name}{' '}
+ {topThree[1] && topThree[1].volunteer_last_name}{' '}
+
{topThree[1] && truncate(topThree[1].total_weight, 2)} lbs
-
+
3{' '}
{' '}
-
- {topThree[2] && topThree[2].volunteer_first_name}{' '}
- {topThree[2] && topThree[2].volunteer_last_name}{' '}
+
+
+ {topThree[2] && topThree[2].volunteer_first_name}{' '}
+ {topThree[2] && topThree[2].volunteer_last_name}{' '}
+
{topThree[2] && truncate(topThree[2].total_weight, 2)} lbs
@@ -215,13 +261,19 @@ const Volunteers = () => {
style={{
whiteSpace: 'normal',
wordWrap: 'break-word',
+ color: 'white',
+ my: "3"
}}
height={'fit-content'}
>
{' '}
-
+
Export All Volunteer Data
-
+
|