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

157 refactor archive events flow to delete events flow #162

Merged
merged 3 commits into from
Apr 17, 2024
Merged
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
50 changes: 0 additions & 50 deletions src/components/Events/ArchiveEventsModal.jsx

This file was deleted.

54 changes: 54 additions & 0 deletions src/components/Events/DeleteEventsModal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import {
Button,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalOverlay,
} from '@chakra-ui/react';
import PropTypes from 'prop-types';

const DeleteEventsModal = ({ isOpen, onClose, events, confirmDelete }) => {
// Function to format event names separated by commas, except the last one
const formattedEventNames = events.map(event => event.name).join(', ');

// Determine the correct event label based on the number of events
const eventLabel = events.length > 1 ? 'Events' : 'Event';

return (
<Modal isOpen={isOpen} onClose={onClose} isCentered>
<ModalOverlay />
<ModalContent style={{padding:"30px", borderRadius:"20px"}}>
<ModalCloseButton />
<ModalBody
padding={6}
textAlign="center"
fontWeight="800"
fontSize="32px"
lineHeight="33.71px"
fontFamily="Avenir, sans-serif"
style={{ display: 'block' }} // Ensure text alignment applies correctly
>
Are you sure you want to delete: {formattedEventNames} {eventLabel}?
</ModalBody>
<ModalFooter justifyContent="center">
<Button onClick={onClose} mr={3} style={{ backgroundColor: 'white', fondSize:'20px',borderRadius: '5px', color:'#0075FF', border:'1px solid #0075FF', width:'130px'}}>Cancel</Button>

<Button colorScheme="red" style={{width:'130px', fondSize:'20px'}} onClick={confirmDelete}>
Delete {eventLabel}
</Button>
</ModalFooter>
</ModalContent>
</Modal>
);
};

DeleteEventsModal.propTypes = {
isOpen: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
confirmDelete: PropTypes.func.isRequired,
events: PropTypes.array.isRequired,
};

export default DeleteEventsModal;
3 changes: 2 additions & 1 deletion src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const NavbarButton = ({ buttonText, path, navigate, UnfocusedIcon, FocusedIcon }
marginBottom="6px"
backgroundColor={location.pathname === path ? '#D4E4F9' : 'transparent'}
borderRadius="4px"
cursor="pointer"
onClick={e => {
e.preventDefault();
navigate(path);
Expand Down Expand Up @@ -110,7 +111,7 @@ const Navbar = () => {
alignItems="start"
>
{/* Box containing everything above "support" */}
<Box display="flex" flexDir="column" width={'full'} as="a" href="/">
<Box display="flex" flexDir="column" width={'full'}>
{/* Box containing the logo and role title at the top */}
<Flex align={'center'} justifyContent={'space-between'} pr={7}>
<Box
Expand Down
Loading
Loading