Skip to content

Commit

Permalink
🔨 Handle generic modal close event (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmount authored and MelissaAutumn committed Oct 15, 2024
1 parent f77086f commit 1efd66c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
52 changes: 26 additions & 26 deletions frontend/src/components/GenericModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,33 @@ onUnmounted(() => {
<div class="new-design overlay" role="dialog" tabindex="-1" aria-labelledby="title" aria-modal="true">
<div class="dismiss-zone" @click="emits('close')"></div>
<div class="modal">
<link-button class="modal-close" v-if="closable" @click="emits('close')" aria-labelledby="modal-close-button">
<img id="modal-close-button" src="@/assets/svg/icons/close.svg" :alt="t('label.close')" :title="t('label.close')"/>
</link-button>
<div class="modal-header">
<slot name="header"></slot>
<notice-bar type="error" v-if="errorMessage">
{{ errorMessage }}
</notice-bar>
<notice-bar type="warning" v-else-if="warningMessage">
{{ warningMessage }}
</notice-bar>
<notice-bar v-else-if="infoMessage">
{{ infoMessage }}
</notice-bar>
<div class="pls-keep-height" v-else/>
</div>
<div class="modal-body">
<slot></slot>
</div>
<div class="modal-actions">
<slot name="actions"></slot>
</div>
<div class="divider"></div>
<div class="footer">
<slot name="footer"></slot>
</div>
<link-button class="modal-close" v-if="closable" @click="emits('close')" aria-labelledby="modal-close-button">
<img id="modal-close-button" src="@/assets/svg/icons/close.svg" :alt="t('label.close')" :title="t('label.close')"/>
</link-button>
<div class="modal-header">
<slot name="header"></slot>
<notice-bar type="error" v-if="errorMessage">
{{ errorMessage }}
</notice-bar>
<notice-bar type="warning" v-else-if="warningMessage">
{{ warningMessage }}
</notice-bar>
<notice-bar v-else-if="infoMessage">
{{ infoMessage }}
</notice-bar>
<div class="pls-keep-height" v-else/>
</div>
<div class="modal-body">
<slot></slot>
</div>
<div class="modal-actions">
<slot name="actions"></slot>
</div>
<div class="divider"></div>
<div class="footer">
<slot name="footer"></slot>
</div>
</div>
</div>
</template>
<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/WaitingListActionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ onMounted(async () => {
<template>
<div>
<home-view></home-view>
<generic-modal :error-message="errorMsg">
<generic-modal :error-message="errorMsg" @close="() => router.push({name: 'home'})">
<template v-slot:header>
<word-mark/>
<h2 id="title" v-if="isError">
Expand Down

0 comments on commit 1efd66c

Please sign in to comment.