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

added heading for no events #207

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
19 changes: 16 additions & 3 deletions src/components/Events/EventFilteredGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ import Fuse from 'fuse.js';

import UserContext from '../../utils/UserContext';

const EventFilteredGrid = ({ setCurrentEventId, setIsOpen, setShowOpenDrawerButton, isOpen, onlyUnregistered=false }) => {
const EventFilteredGrid = ({
setCurrentEventId,
setIsOpen,
setShowOpenDrawerButton,
isOpen,
onlyUnregistered = false,
}) => {
const [events, setEvents] = useState([]);
const [displayEvents, setDisplayEvents] = useState([]);

Expand Down Expand Up @@ -87,6 +93,8 @@ const EventFilteredGrid = ({ setCurrentEventId, setIsOpen, setShowOpenDrawerButt
getEvents();
}, []);

console.log(events.length);

const handleLocationChange = event => {
const selectedLocation = event.target.value;
setLocation(selectedLocation);
Expand Down Expand Up @@ -134,7 +142,7 @@ const EventFilteredGrid = ({ setCurrentEventId, setIsOpen, setShowOpenDrawerButt

return (
<>
{/* Flag: Navbar responsive (Use 15%) */}
{/* Flag: Navbar responsive (Use 15%) */}
<Flex
flexDir={'column'}
alignItems={'center'}
Expand Down Expand Up @@ -254,6 +262,11 @@ const EventFilteredGrid = ({ setCurrentEventId, setIsOpen, setShowOpenDrawerButt
</Grid>
</Box>
</Flex>
{events.length === 0 && (
<Heading color={'gray'} my={20}>
No Events Found
</Heading>
)}
</Flex>
</>
);
Expand All @@ -264,7 +277,7 @@ EventFilteredGrid.propTypes = {
setIsOpen: PropTypes.func.isRequired,
setShowOpenDrawerButton: PropTypes.func.isRequired,
isOpen: PropTypes.bool.isRequired,
onlyUnregistered: PropTypes.bool
onlyUnregistered: PropTypes.bool,
};

export default EventFilteredGrid;
2 changes: 1 addition & 1 deletion src/components/Events/PastEventsImpactSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const PastEventsImpactSummary = () => {
useEffect(() => {
const getEventId = async () => {
try {
const eventIdData = await Backend.get(`/stats/export/data`);
const eventIdData = await Backend.get(`/stats/export/data/past`);
setEventIdData(eventIdData.data);
} catch (err) {
console.log(err.message);
Expand Down
3 changes: 0 additions & 3 deletions src/components/VolunteerSideView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ const VolunteerSideView = ({ eventId, onClose, setShowOpenDrawerButton }) => {
const formatted_end_time = `${datePart}T${eventData.end_time.substring(0, 8)}`;

// test the dates are correct
console.log('the is date', eventData.date, 'but the part we want is', datePart);
console.log('ICS start time:', formatted_start_time, 'ICS End time:', formatted_end_time);
console.log('real start time:', eventData.start_time, 'real end time:', eventData.end_time);
// const calendarFile = new File([calendar.toString()], 'event.ics', { type: 'text/calendar' });
// const url = URL.createObjectURL(calendarFile);
// setICSURL(url);
Expand Down
5 changes: 5 additions & 0 deletions src/pages/VolunteerHomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ const VolunteerHomePage = () => {
</Flex>
</Box>
</Flex>
{events.length === 0 && (
<Heading color={'gray'} my={20}>
No Events Found
</Heading>
)}
</Flex>
{breakpoint == 'base' ? (
<VolunteerSideViewDrawer
Expand Down