Files
AstralRinth/apps/app-frontend/src/components/ui/modal/ModalWrapper.vue
didirus4 7e58d7dd35
Some checks failed
AstralRinth App Build / build (ubuntu-latest) (push) Failing after 14m17s
AstralRinth App Build / build (macos-latest) (push) Has been cancelled
AstralRinth App Build / build (windows-latest) (push) Has been cancelled
Merge commit '8faea1663ae0c6d1190a5043054197b6a58019f3' into feature-clean
2025-07-05 23:11:27 +03:00

58 lines
1.1 KiB
Vue

<script setup lang="ts">
import { useTemplateRef } from 'vue'
import { NewModal as Modal } from '@modrinth/ui'
// import { show_ads_window, hide_ads_window } from '@/helpers/ads.js'
import { useTheming } from '@/store/theme.js'
const themeStore = useTheming()
const props = defineProps({
header: {
type: String,
default: null,
},
closable: {
type: Boolean,
default: true,
},
onHide: {
type: Function,
default() {
return () => { }
},
},
// showAdOnClose: {
// type: Boolean,
// default: true,
// },
})
const modal = useTemplateRef('modal')
defineExpose({
show: (e: MouseEvent) => {
// hide_ads_window()
modal.value?.show(e)
},
hide: () => {
onModalHide()
modal.value?.hide()
},
})
function onModalHide() {
// if (props.showAdOnClose) {
// show_ads_window()
// }
props.onHide?.()
}
</script>
<template>
<Modal ref="modal" :header="header" :noblur="!themeStore.advancedRendering" @hide="onModalHide">
<template #title>
<slot name="title" />
</template>
<slot />
</Modal>
</template>