Add quick server button, dynamic price preview for custom server modal (#3815)

* Add quick server creation button, and dynamic pricing to custom server selection

* Remove test in compatibility card

* Lint + remove duplicate file

* Adjust z-index of popup

* $6 -> $5

* Dismiss prompt if the button is clicked

* Make "Create a server" disabled for now

* Use existing loaders type
This commit is contained in:
Prospector
2025-06-26 08:38:42 -07:00
committed by GitHub
parent 47af459f24
commit c793b68aed
15 changed files with 362 additions and 92 deletions

View File

@@ -1,7 +1,14 @@
import type Stripe from 'stripe'
import type { Loaders } from '@modrinth/utils'
export type ServerBillingInterval = 'monthly' | 'yearly' | 'quarterly'
export const monthsInInterval: Record<ServerBillingInterval, number> = {
monthly: 1,
quarterly: 3,
yearly: 12,
}
export interface ServerPlan {
id: string
name: string
@@ -72,11 +79,18 @@ export type CreatePaymentIntentRequest = PaymentRequestType & {
type: 'pyro'
server_name?: string
server_region?: string
source: {
loader?: string
game_version?: string
loader_version?: string
}
source:
| {
loader: Loaders
game_version?: string
loader_version?: string
}
| {
project_id: string
version_id?: string
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
| {}
}
}