feat: implement invite modal in guild options menu
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
This commit is contained in:
parent
21cb1c37df
commit
7dcd80cdf7
1 changed files with 24 additions and 6 deletions
|
@ -4,11 +4,13 @@
|
||||||
<button class="guild-option-button" @click="setting.action">{{ setting.name }}</button>
|
<button class="guild-option-button" @click="setting.action">{{ setting.name }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<InviteModal ref="modal" v-if="showInviteModal" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { InvitePopup } from '#components';
|
import { InviteModal } from '#components';
|
||||||
|
|
||||||
|
const modal = ref<HTMLDialogElement>();
|
||||||
|
|
||||||
const showInviteModal = ref(false);
|
const showInviteModal = ref(false);
|
||||||
|
|
||||||
|
@ -17,16 +19,33 @@ const settings = [
|
||||||
{ name: "Invite", icon: "lucide:letter", action: openInviteModal }
|
{ name: "Invite", icon: "lucide:letter", action: openInviteModal }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (modal.value) {
|
||||||
|
modal.value.addEventListener("close", () => {
|
||||||
|
console.log("MODAL CLOSED");
|
||||||
|
showInviteModal.value = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.value.addEventListener("cancel", () => {
|
||||||
|
console.log("MODAL CANCELED");
|
||||||
|
showInviteModal.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function openInviteModal() {
|
function openInviteModal() {
|
||||||
//showInviteModal.value = !showInviteModal.value;
|
showInviteModal.value = true;
|
||||||
//const invitePopup = createApp(InvitePopup);
|
const invitePopup = h(InviteModal);
|
||||||
//invitePopup
|
}
|
||||||
|
|
||||||
|
function toggleInviteModal(e: Event) {
|
||||||
|
e.preventDefault();
|
||||||
|
showInviteModal.value = !showInviteModal.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
#guild-options-container {
|
#guild-options-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -54,5 +73,4 @@ function openInviteModal() {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
color: var(--main-text-color);
|
color: var(--main-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
Loading…
Add table
Add a link
Reference in a new issue