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>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ModalProfilePopup } from '#components';
|
||||
import type { ContextMenuInterface, GuildMemberResponse } from '~/types/interfaces';
|
||||
import type { GuildMemberResponse, IConfirmationModal } from '~/types/interfaces';
|
||||
|
||||
const { getDisplayName } = useProfile()
|
||||
|
||||
|
@ -19,10 +22,12 @@ const props = defineProps<{
|
|||
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);
|
||||
|
||||
|
||||
function showModalPopup() {
|
||||
modalPopupVisible.value = true
|
||||
}
|
||||
|
@ -30,6 +35,14 @@ function showModalPopup() {
|
|||
function hideModalPopup() {
|
||||
modalPopupVisible.value = false
|
||||
}
|
||||
|
||||
function resetConfirmationModal() {
|
||||
console.log("[CONFIRM] resetting");
|
||||
if (confirmationModal) {
|
||||
confirmationModal.value = { show: false, actionName: "", callback: () => {} };
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue