mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
hook up purchase server modal in app
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// src/config.ts
|
||||
export const config = {
|
||||
siteUrl: import.meta.env.VITE_SITE_URL,
|
||||
stripePublishableKey:
|
||||
import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY ||
|
||||
'pk_test_51JbFxJJygY5LJFfKV50mnXzz3YLvBVe2Gd1jn7ljWAkaBlRz3VQdxN9mXcPSrFbSqxwAb0svte9yhnsmm7qHfcWn00R611Ce7b',
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import type { Labrinth } from '@modrinth/api-client'
|
||||
import { injectModrinthClient, ServersManagePageIndex } from '@modrinth/ui'
|
||||
import { useQuery } from '@tanstack/vue-query'
|
||||
import { computed } from 'vue'
|
||||
import { config } from '../config'
|
||||
|
||||
const stripePublishableKey = (config.stripePublishableKey as string) || ''
|
||||
|
||||
const client = injectModrinthClient()
|
||||
|
||||
const { data: products } = useQuery({
|
||||
queryKey: ['billing', 'products'],
|
||||
queryFn: () => client.labrinth.billing_internal.getProducts(),
|
||||
})
|
||||
|
||||
const resolvedProducts = computed<Labrinth.Billing.Internal.Product[]>(() => products.value ?? [])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ServersManagePageIndex
|
||||
:stripe-publishable-key="stripePublishableKey"
|
||||
:site-url="'https://modrinth.com'"
|
||||
:products="resolvedProducts"
|
||||
/>
|
||||
</template>
|
||||
@@ -1,6 +1,7 @@
|
||||
import Browse from './Browse.vue'
|
||||
import Index from './Index.vue'
|
||||
import Servers from './Servers.vue'
|
||||
import Skins from './Skins.vue'
|
||||
import Worlds from './Worlds.vue'
|
||||
|
||||
export { Browse, Index, Skins, Worlds }
|
||||
export { Browse, Index, Servers, Skins, Worlds }
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ServersManagePageIndex } from '@modrinth/ui'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
import * as Pages from '@/pages'
|
||||
@@ -31,7 +30,7 @@ export default new createRouter({
|
||||
{
|
||||
path: '/hosting/manage/',
|
||||
name: 'Servers',
|
||||
component: ServersManagePageIndex,
|
||||
component: Pages.Servers,
|
||||
meta: {
|
||||
breadcrumb: [{ name: 'Servers' }],
|
||||
},
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
"strict": true,
|
||||
|
||||
"types": ["vite/client"],
|
||||
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user