feat: medal promotion on servers page (#4117)

* feat: medal promotion on servers page

* feat: medal server card

* fix: styling changes

* fix: colors for dark mode only

* fix: light mode medal promotion

* feat: finish server card layout

* feat: countdown on server panel

* fix: lint

* feat: use same gradient as promo

* fix: scale for medal bg

* fix: border around server icon

* feat: medal subscr expiry date stuff

* feat: progress on plans within the modal

* feat: finalize plan modal stage

* fix: unused scss

* feat: remove buttons from cards

* feat: upgrade button opens modal on server panel

* feat: billing endpoint

* fix: lint issues

* fix: lint issues

* fix: lint issues

* feat: better handling of downgrades + existing plan checks

* feat: update medal url

* feat: proration visual in modal

* feat: standardize upgrade modal into ServersUpgradeModalWrapper

* feat: replace upgrade PurchaseModal with ServersUpgradeModalWrapper

* feat: allow server region

* fix: lint

* fix: lint

* fix: medal frontend completion

* fix: lint issues

* feat: ad

* fix: hover tooltip + orange new server sparkle

* feat: ad

* fix: lint issues new eslint

* feat: match ad

* feat: support for ?dry=true

* fix: lint isuses

* fix: lint issues

* fix: TeleportDropdownMenu imports

* fix: hash nav issues

* feat: clarify confirm changes btn

* fix: lint issues

* fix: "Using new payment method"

* fix: lint

* fix: re-add -mt-2

---------

Signed-off-by: Cal H. <hendersoncal117@gmail.com>
This commit is contained in:
Cal H.
2025-08-18 18:59:19 +01:00
committed by GitHub
parent 9af1391e0e
commit 14eac461be
34 changed files with 2476 additions and 285 deletions

View File

@@ -52,6 +52,9 @@ export interface Server {
flows: {
intro?: boolean
}
is_medal?: boolean
medal_expires?: string
}
export interface Servers {

View File

@@ -37,6 +37,7 @@ export interface ServerGeneral {
flows?: {
intro?: boolean
}
is_medal?: boolean
}
export interface Allocation {

View File

@@ -513,6 +513,38 @@ export interface ModerationJudgements {
[sha1: string]: ModerationJudgement
}
// Subscriptions
export interface UserSubscription {
id: string
user_id: string
price_id: string
interval: 'five-days' | 'monthly' | 'quarterly' | 'yearly'
status: 'provisioned' | 'unprovisioned'
created: string // ISO date string
metadata?: SubscriptionMetadata
}
export interface Charge {
id: string
user_id: string
price_id: string
amount: number
currency_code: string
status: 'open' | 'processing' | 'succeeded' | 'failed' | 'cancelled' | 'expiring'
due: string // ISO date string
last_attempt?: string // ISO date string
type: 'one-time' | 'subscription' | 'proration' | 'refund'
subscription_id?: string
subscription_interval?: 'five-days' | 'monthly' | 'quarterly' | 'yearly'
platform: 'stripe' | 'none'
parent_charge_id?: string
net?: number
}
export type SubscriptionMetadata =
| { type: 'pyro'; id: string; region?: string }
| { type: 'medal'; id: string }
// Delphi
export interface DelphiReport {
id: string