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