feat: programmatically create invite modal

This commit is contained in:
SauceyRed 2025-07-13 00:56:47 +02:00
parent e73df90310
commit 7ae7bc6d76
Signed by: sauceyred
GPG key ID: 270B096EF6E9A462

View file

@ -7,24 +7,20 @@
</template>
<script lang="ts" setup>
import { InviteModal } from '#components';
const modal = ref<HTMLDialogElement>();
const showInviteModal = ref(false);
import { render } from 'vue';
import InviteModal from './InviteModal.vue';
const settings = [
{ name: "Invite", icon: "lucide:letter", action: openInviteModal }
]
function openInviteModal() {
showInviteModal.value = true;
const invitePopup = h(InviteModal);
}
function toggleInviteModal(e: Event) {
e.preventDefault();
showInviteModal.value = !showInviteModal.value;
const div = document.createElement("div");
const guildId = useRoute().params.serverId as string;
console.log("guild id:", guildId);
const inviteModal = h(InviteModal, { guildId });
document.body.appendChild(div);
render(inviteModal, div);
}
</script>