You've already forked pages
forked from didirus/AstralRinth
* Tabbed interface component * Start instance settings * New instance settings, mostly done minus modpacks * Extract i18n * Some more fixes with settings, still no modpacks yet * Lint * Modpack installation settings * Change no friends language * Remove options legacy button * fix lint, small bug * fix invalid cond on friends ui * update resource management page --------- Signed-off-by: Geometrically <18202329+Geometrically@users.noreply.github.com> Co-authored-by: Jai A <jaiagr+gpg@pm.me> Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
58 lines
1.0 KiB
Vue
58 lines
1.0 KiB
Vue
<script setup lang="ts">
|
|
import { ref } 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 = ref(null)
|
|
|
|
defineExpose({
|
|
show: () => {
|
|
hide_ads_window()
|
|
modal.value.show()
|
|
},
|
|
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>
|