diff --git a/frontend/app.vue b/frontend/app.vue index 765340146..bd91bc4cd 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -14,6 +14,7 @@ @@ -28,15 +29,18 @@ useHead({ return titleChunk ? `${titleChunk} • activist` : "activist"; }, }); - +const modals = useModals(); +const modalName = "generalModal"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; const { isMacOS } = useDevice(); diff --git a/frontend/components/card/CardDetails.vue b/frontend/components/card/CardDetails.vue index 935b032f2..814922ca5 100644 --- a/frontend/components/card/CardDetails.vue +++ b/frontend/components/card/CardDetails.vue @@ -46,17 +46,22 @@ diff --git a/frontend/components/card/about/CardAboutEvent.vue b/frontend/components/card/about/CardAboutEvent.vue index 34cfd8e12..c2d1efb93 100644 --- a/frontend/components/card/about/CardAboutEvent.vue +++ b/frontend/components/card/about/CardAboutEvent.vue @@ -93,13 +93,17 @@ function expand_reduce_text() { expandText.value = !expandText.value; } +const modals = useModals(); +const modalName = "ModalEditAboutEvent"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/card/about/CardAboutGroup.vue b/frontend/components/card/about/CardAboutGroup.vue index d6804c5c4..83c702444 100644 --- a/frontend/components/card/about/CardAboutGroup.vue +++ b/frontend/components/card/about/CardAboutGroup.vue @@ -119,13 +119,17 @@ function expand_reduce_text() { expandText.value = !expandText.value; } +const modals = useModals(); +const modalName = "ModalEditAboutGroup"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/card/about/CardAboutOrganization.vue b/frontend/components/card/about/CardAboutOrganization.vue index 3b5d368d0..599d203cb 100644 --- a/frontend/components/card/about/CardAboutOrganization.vue +++ b/frontend/components/card/about/CardAboutOrganization.vue @@ -118,13 +118,17 @@ function expand_reduce_text() { expandText.value = !expandText.value; } +const modals = useModals(); +const modalName = "ModalEditAboutOrganization"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/card/get-involved/CardGetInvolvedEvent.vue b/frontend/components/card/get-involved/CardGetInvolvedEvent.vue index 873c521be..8090d044f 100644 --- a/frontend/components/card/get-involved/CardGetInvolvedEvent.vue +++ b/frontend/components/card/get-involved/CardGetInvolvedEvent.vue @@ -52,13 +52,17 @@ defineProps<{ disclaimer?: string; }>(); +const modals = useModals(); +const modalName = "ModalEditAboutEvent"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/card/get-involved/CardGetInvolvedGroup.vue b/frontend/components/card/get-involved/CardGetInvolvedGroup.vue index 197e6f538..91658b8a1 100644 --- a/frontend/components/card/get-involved/CardGetInvolvedGroup.vue +++ b/frontend/components/card/get-involved/CardGetInvolvedGroup.vue @@ -51,13 +51,17 @@ defineProps<{ disclaimer?: string; }>(); +const modals = useModals(); +const modalName = "ModalEditAboutGroup"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/card/get-involved/CardGetInvolvedOrganization.vue b/frontend/components/card/get-involved/CardGetInvolvedOrganization.vue index e6b8baa3b..bcca4bed1 100644 --- a/frontend/components/card/get-involved/CardGetInvolvedOrganization.vue +++ b/frontend/components/card/get-involved/CardGetInvolvedOrganization.vue @@ -72,13 +72,17 @@ await organizationStore.fetchByID(id); const { organization } = organizationStore; +const modals = useModals(); +const modalName = "ModalEditAboutOrganization"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/icon/IconOrganizationStatus.vue b/frontend/components/icon/IconOrganizationStatus.vue index 5ccca89d2..56ee21d26 100644 --- a/frontend/components/icon/IconOrganizationStatus.vue +++ b/frontend/components/icon/IconOrganizationStatus.vue @@ -74,14 +74,17 @@ defineProps<{ status: number; organization: Organization; }>(); - +const modals = useModals(); +const modalName = "ModalOrganizationStatus"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/media/image-carousel/MediaImageCarousel.vue b/frontend/components/media/image-carousel/MediaImageCarousel.vue index 763810e5a..5a8334337 100644 --- a/frontend/components/media/image-carousel/MediaImageCarousel.vue +++ b/frontend/components/media/image-carousel/MediaImageCarousel.vue @@ -52,15 +52,18 @@ const imageUrls = [ `${GET_ORGANIZED_IMAGE_URL}_${imageColor}.png`, `${GROW_ORGANIZATION_IMAGE_URL}_${imageColor}.png`, ]; - +const modals = useModals(); +const modalName = "ModalUploadImages"; const modalIsOpen = ref(false); function openModal() { - modalIsOpen.value = true; + modals.openModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; } const handleCloseModal = () => { - modalIsOpen.value = false; + modals.closeModal(modalName); + modalIsOpen.value = modals.modals[modalName].isOpen; }; diff --git a/frontend/components/media/image-carousel/MediaImageCarouselFull.vue b/frontend/components/media/image-carousel/MediaImageCarouselFull.vue index 9e2f06498..9f10f73f7 100644 --- a/frontend/components/media/image-carousel/MediaImageCarouselFull.vue +++ b/frontend/components/media/image-carousel/MediaImageCarouselFull.vue @@ -18,13 +18,18 @@ diff --git a/frontend/components/modal/ModalBase.vue b/frontend/components/modal/ModalBase.vue index dc31320d6..4a3ee7e44 100644 --- a/frontend/components/modal/ModalBase.vue +++ b/frontend/components/modal/ModalBase.vue @@ -1,9 +1,5 @@