Skip to content

Commit f0fbab8

Browse files
committed
feat: disable financial stuff on app frontend
1 parent f924255 commit f0fbab8

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

apps/frontend/src/components/ui/servers/ServersUpgradeModalWrapper.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
</template>
99

1010
<script setup lang="ts">
11-
import ServersUpgradeModalWrapperBase from '@modrinth/ui/src/components/billing/ServersUpgradeModalWrapper.vue'
11+
// TODO: Remove this wrapper when we figure out how to do cross platform state + stripe
12+
import { ServersUpgradeModalWrapper as ServersUpgradeModalWrapperBase } from '@modrinth/ui'
1213
import { useGeneratedState } from '~/composables/generated'
1314
1415
const config = useRuntimeConfig()

packages/ui/src/components/servers/marketing/MedalServerListing.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
</div>
8181
</AutoLink>
8282

83-
<div class="z-10 ml-auto">
83+
<div class="z-10 ml-auto" v-if="isNuxt">
8484
<ButtonStyled color="medal-promo" type="outlined" size="large">
8585
<button class="my-auto" @click="handleUpgrade"><RocketIcon /> Upgrade</button>
8686
</ButtonStyled>
@@ -128,7 +128,7 @@
128128
</template>
129129

130130
<script setup lang="ts">
131-
import type { Archon } from '@modrinth/api-client'
131+
import { NuxtModrinthClient, type Archon } from '@modrinth/api-client'
132132
import {
133133
ChevronRightIcon,
134134
LoaderCircleIcon,
@@ -157,6 +157,8 @@ const emit = defineEmits<{ (e: 'upgrade'): void }>()
157157
158158
const client = injectModrinthClient()
159159
160+
const isNuxt = computed(() => client instanceof NuxtModrinthClient)
161+
160162
const showGameLabel = computed(() => !!props.game)
161163
const showLoaderLabel = computed(() => !!props.loader)
162164

packages/ui/src/pages/servers/manage/index.vue

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
class="experimental-styles-within relative mx-auto mb-6 flex min-h-screen w-full max-w-[1280px] flex-col px-6"
55
>
66
<ServersUpgradeModalWrapper
7+
v-if="stripePublishableKey && siteUrl && products"
78
ref="upgradeModal"
8-
:stripe-publishable-key="props.stripePublishableKey"
9-
:site-url="props.siteUrl"
10-
:products="props.products"
9+
:stripe-publishable-key
10+
:site-url
11+
:products
1112
/>
1213

1314
<div
@@ -189,15 +190,15 @@ import { computed, onMounted, ref, watch } from 'vue'
189190
import { useRoute, useRouter } from 'vue-router'
190191
191192
import ServersUpgradeModalWrapper from '../../../components/billing/ServersUpgradeModalWrapper.vue'
192-
193-
const props = defineProps<{
194-
stripePublishableKey: string
195-
siteUrl: string
196-
products: Labrinth.Billing.Internal.Product[]
197-
}>()
198193
import MedalServerListing from '../../../components/servers/marketing/MedalServerListing.vue'
199194
import ServerListing from '../../../components/servers/ServerListing.vue'
200195
196+
defineProps<{
197+
stripePublishableKey?: string
198+
siteUrl?: string
199+
products?: Labrinth.Billing.Internal.Product[]
200+
}>()
201+
201202
const router = useRouter()
202203
const route = useRoute()
203204
const { labrinth, archon } = injectModrinthClient()

0 commit comments

Comments
 (0)