You've already forked AstralRinth
* New envs frontend * lint fix * Add blog post, user-facing changes, dashboard warning, project page member warning, and migration reviewing. maybe some other misc stuff * lint * lint * ignore .data in .prettierignore * i18n as fuck * fix proj page * Improve news markdown rendering * improve phrasing of initial paragraph * Fix environments not reloading after save * index.ts instead of underscored name * shrink-0 back on these icons
37 lines
928 B
Vue
37 lines
928 B
Vue
<template>
|
|
<NuxtLayout>
|
|
<ModrinthLoadingIndicator />
|
|
<NotificationPanel />
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import { NotificationPanel, provideNotificationManager } from '@modrinth/ui'
|
|
import { provideApi } from '@modrinth/ui/src/providers/api.ts'
|
|
import { RestModrinthApi } from '@modrinth/utils'
|
|
|
|
import ModrinthLoadingIndicator from '~/components/ui/modrinth-loading-indicator.ts'
|
|
|
|
import { FrontendNotificationManager } from './providers/frontend-notifications.ts'
|
|
|
|
provideNotificationManager(new FrontendNotificationManager())
|
|
|
|
provideApi(
|
|
new RestModrinthApi((url: string, options?: object) => {
|
|
const match = url.match(/^\/v(\d+)\/(.+)$/)
|
|
|
|
if (match) {
|
|
const apiVersion = Number(match[1])
|
|
const path = match[2]
|
|
|
|
return useBaseFetch(path, {
|
|
...options,
|
|
apiVersion,
|
|
}) as Promise<Response>
|
|
} else {
|
|
throw new Error('Invalid format')
|
|
}
|
|
}),
|
|
)
|
|
</script>
|