feat: add Confirmation modal to MemberEntry.vue
This commit is contained in:
parent
e28bc23d12
commit
8b8c0591a5
1 changed files with 16 additions and 3 deletions
|
@ -6,12 +6,15 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<ModalProfilePopup v-if="modalPopupVisible" :profile="props.member"
|
<ModalProfilePopup v-if="modalPopupVisible" :profile="props.member"
|
||||||
:onFinish="hideModalPopup" :keepalive="false"/>
|
:onFinish="hideModalPopup" :keepalive="false" />
|
||||||
|
<ModalConfirmation v-if="confirmationModal && confirmationModal.show" :action-name="confirmationModal.actionName"
|
||||||
|
:target-name="getDisplayName(props.member)" :callback="confirmationModal.callback"
|
||||||
|
:onClose="resetConfirmationModal" :onCancel="resetConfirmationModal" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ModalProfilePopup } from '#components';
|
import { ModalProfilePopup } from '#components';
|
||||||
import type { ContextMenuInterface, GuildMemberResponse } from '~/types/interfaces';
|
import type { GuildMemberResponse, IConfirmationModal } from '~/types/interfaces';
|
||||||
|
|
||||||
const { getDisplayName } = useProfile()
|
const { getDisplayName } = useProfile()
|
||||||
|
|
||||||
|
@ -19,10 +22,12 @@ const props = defineProps<{
|
||||||
member: GuildMemberResponse
|
member: GuildMemberResponse
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const menuSections = await createMemberContextMenuItems(props.member, props.member.guild_uuid);
|
const confirmationModal = ref<IConfirmationModal>();
|
||||||
|
const menuSections = await createMemberContextMenuItems(props.member, props.member.guild_uuid, confirmationModal);
|
||||||
|
|
||||||
const modalPopupVisible = ref<boolean>(false);
|
const modalPopupVisible = ref<boolean>(false);
|
||||||
|
|
||||||
|
|
||||||
function showModalPopup() {
|
function showModalPopup() {
|
||||||
modalPopupVisible.value = true
|
modalPopupVisible.value = true
|
||||||
}
|
}
|
||||||
|
@ -30,6 +35,14 @@ function showModalPopup() {
|
||||||
function hideModalPopup() {
|
function hideModalPopup() {
|
||||||
modalPopupVisible.value = false
|
modalPopupVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetConfirmationModal() {
|
||||||
|
console.log("[CONFIRM] resetting");
|
||||||
|
if (confirmationModal) {
|
||||||
|
confirmationModal.value = { show: false, actionName: "", callback: () => {} };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue