mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-24 08:57:25 +00:00
refactor(licensing): replace Pro branding with Community/Skipper/Admiral tiers (#375)
Eliminate all references to "Pro" across backend, frontend, and docs. Internal tier value renamed from 'pro' to 'paid'; user-facing text now uses the thematic tier names (Community, Skipper, Admiral). - Rename LicenseTier 'pro' to 'paid' in backend and frontend types - Rename requirePro guard to requirePaid, error code PRO_REQUIRED to PAID_REQUIRED - Rename ProGate.tsx to PaidGate.tsx with updated copy - Fix: trial users can now see upgrade/purchase cards in Settings - Update all docs and openapi.yaml to use correct tier names
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { createContext, useContext, useState, useEffect, useCallback, type ReactNode } from 'react';
|
||||
import { apiFetch } from '@/lib/api';
|
||||
|
||||
export type LicenseTier = 'community' | 'pro';
|
||||
export type LicenseTier = 'community' | 'paid';
|
||||
export type LicenseStatus = 'community' | 'trial' | 'active' | 'expired' | 'disabled';
|
||||
|
||||
export type LicenseVariant = 'personal' | 'team' | null;
|
||||
@@ -21,7 +21,7 @@ export interface LicenseInfo {
|
||||
|
||||
interface LicenseContextType {
|
||||
license: LicenseInfo | null;
|
||||
isPro: boolean;
|
||||
isPaid: boolean;
|
||||
loading: boolean;
|
||||
refresh: () => Promise<void>;
|
||||
activate: (licenseKey: string) => Promise<{ success: boolean; error?: string }>;
|
||||
@@ -87,10 +87,10 @@ export function LicenseProvider({ children }: { children: ReactNode }) {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const isPro = license?.tier === 'pro';
|
||||
const isPaid = license?.tier === 'paid';
|
||||
|
||||
return (
|
||||
<LicenseContext.Provider value={{ license, isPro, loading, refresh, activate, deactivate }}>
|
||||
<LicenseContext.Provider value={{ license, isPaid, loading, refresh, activate, deactivate }}>
|
||||
{children}
|
||||
</LicenseContext.Provider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user