Skip to content

Commit

Permalink
reviewing
Browse files Browse the repository at this point in the history
  • Loading branch information
NwinNwin committed May 6, 2024
1 parent 10df806 commit 2d8afc8
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/pages/VolunteerEventPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const VolunteerEventPage = () => {
const { onNavbarDrawerOpen } = useContext(NavbarContext);
const [currentEventId, setCurrentEventId] = useState(null); // Initial state is null to indicate no event selected
const breakpoint = useBreakpoint();
const [setShowOpenDrawerButton] = useState(false);
const [showOpenDrawerButton, setShowOpenDrawerButton] = useState(false);

const openEventDrawer = eventId => {
setCurrentEventId(eventId); // Set the current event ID, which triggers the side view to display
Expand Down Expand Up @@ -82,6 +82,7 @@ const VolunteerEventPage = () => {
flex-shrink="0"
borderRadius={'xl'}
flexDir={'column'}
display={showOpenDrawerButton ? { base: 'flex', xl: 'none' } : 'none'}
>
<IconButton
borderRadius="md"
Expand All @@ -100,8 +101,7 @@ const VolunteerEventPage = () => {
<EventFilteredGrid
width={{ base: '90%' }}
setCurrentEventId={openEventDrawer} // Adjusted to call `openEventDrawer`
setCurrentEventId={setCurrentEventId}
setIsOpen={setIsOpen}
// setIsOpen={setIsOpen}
setShowOpenDrawerButton={setShowOpenDrawerButton}
isOpen={isOpen}
/>
Expand All @@ -114,14 +114,16 @@ const VolunteerEventPage = () => {
onClose={handleClose}
setShowOpenDrawerButton={setShowOpenDrawerButton}
/>
) : null}
{isOpen ? (
<VolunteerSideView
eventId={currentEventId}
onClose={handleClose}
setShowOpenDrawerButton={setShowOpenDrawerButton}
/>
) : null}
) : (
isOpen && (
<VolunteerSideView
eventId={currentEventId}
onClose={handleClose}
setShowOpenDrawerButton={setShowOpenDrawerButton}
/>
)
)}
{/* { : null} */}
</Flex>
);
};
Expand Down

0 comments on commit 2d8afc8

Please sign in to comment.