feat: add and use ModalProps interface
This commit is contained in:
parent
6071bbce35
commit
fb452d8a5b
3 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal title="Create an invite">
|
<Modal v-bind="props" :title="props.title || 'Create an invite'">
|
||||||
<div id="invite-popup">
|
<div id="invite-popup">
|
||||||
<div v-if="invite">
|
<div v-if="invite">
|
||||||
<p>{{ invite }}</p>
|
<p>{{ invite }}</p>
|
||||||
|
@ -13,8 +13,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { InviteResponse } from '~/types/interfaces';
|
import type { InviteResponse, ModalProps } from '~/types/interfaces';
|
||||||
|
|
||||||
|
const props = defineProps<ModalProps & { guildId: string }>();
|
||||||
|
|
||||||
const invite = ref<string>();
|
const invite = ref<string>();
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { ModalProps } from '~/types/interfaces';
|
||||||
|
|
||||||
const props = defineProps<{ title: string, heavy?: boolean }>();
|
|
||||||
|
const props = defineProps<ModalProps>();
|
||||||
const dialog = ref<HTMLDialogElement>();
|
const dialog = ref<HTMLDialogElement>();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -87,3 +87,10 @@ export interface DropdownOption {
|
||||||
value: string | number,
|
value: string | number,
|
||||||
callback: () => void
|
callback: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ModalProps {
|
||||||
|
title?: string,
|
||||||
|
heavy?: boolean,
|
||||||
|
onClose?: () => void,
|
||||||
|
onCancel?: () => void
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue