From 1835067016cc31012a7850cf761c14fecfe9b993 Mon Sep 17 00:00:00 2001 From: kanhaiya Date: Thu, 9 Nov 2023 01:26:23 +0530 Subject: [PATCH] fixed the naming conventions and style of the modal --- .../EventListCard/EventListCard.module.css | 2 + .../EventListCard/EventListCard.tsx | 57 ++++++++++--------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/components/EventListCard/EventListCard.module.css b/src/components/EventListCard/EventListCard.module.css index 3f6cb9aa27..c2a8e9eb0e 100644 --- a/src/components/EventListCard/EventListCard.module.css +++ b/src/components/EventListCard/EventListCard.module.css @@ -84,6 +84,8 @@ } .dispflex { display: flex; + margin-bottom: 5px; + margin-right: 5px; } .dispflex > input { width: 20%; diff --git a/src/components/EventListCard/EventListCard.tsx b/src/components/EventListCard/EventListCard.tsx index 8053dfa828..f41c0e9c91 100644 --- a/src/components/EventListCard/EventListCard.tsx +++ b/src/components/EventListCard/EventListCard.tsx @@ -38,8 +38,8 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { const [recurringchecked, setRecurringChecked] = useState(false); const [publicchecked, setPublicChecked] = useState(true); const [registrablechecked, setRegistrableChecked] = React.useState(false); - const [eventDeleteisOpen, setEventDeleteModalIsOpen] = useState(false); - const [eventUpdateisOpen, setEventUpdateModalIsOpen] = useState(false); + const [eventDeleteModalIsOpen, setEventDeleteModalIsOpen] = useState(false); + const [eventUpdateModalIsOpen, setEventUpdateModalIsOpen] = useState(false); const history = useHistory(); const [formState, setFormState] = useState({ title: '', @@ -55,18 +55,12 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { setEventModalIsOpen(false); }; - const showDeleteModal = (): void => { - setEventDeleteModalIsOpen(true); - }; - const hideDeleteModal = (): void => { - setEventDeleteModalIsOpen(false); + const toggleDeleteModal = (): void => { + setEventDeleteModalIsOpen(!eventDeleteModalIsOpen); }; - const showUpdateModel = (): void => { - setEventUpdateModalIsOpen(true); - }; - const hideUpdateModal = (): void => { - setEventUpdateModalIsOpen(false); + const toggleUpdateModel = (): void => { + setEventUpdateModalIsOpen(!eventUpdateModalIsOpen); }; useEffect(() => { @@ -216,7 +210,7 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { size="sm" data-testid="editEventModalBtn" className={styles.icon} - onClick={showUpdateModel} + onClick={toggleUpdateModel} > {' '} @@ -225,7 +219,7 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { size="sm" data-testid="deleteEventModalBtn" className={styles.icon} - onClick={showDeleteModal} + onClick={toggleDeleteModal} > {' '} @@ -239,13 +233,16 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { - - + + {t('deleteEvent')} @@ -255,7 +252,7 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { type="button" className="btn btn-danger" data-dismiss="modal" - onClick={hideDeleteModal} + onClick={toggleDeleteModal} data-testid="EventDeleteModalCloseBtn" > {t('no')} @@ -274,13 +271,16 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { {/* Edit Modal */} - - + + {' '} {t('editEvent')} @@ -291,6 +291,7 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element { {!alldaychecked && (
-
+
-
+