refactor(routes): move shared pages to global scope

This commit is contained in:
2026-07-20 14:02:15 +08:00
parent b216b53f2e
commit 1f7ab2be04
36 changed files with 743 additions and 251 deletions
+3 -9
View File
@@ -38,9 +38,6 @@ export interface CharacterRoutes {
readonly chat: string;
readonly privateRoom: string;
readonly tip: string;
readonly sidebar: string;
readonly feedback: string;
readonly coinsRules: string;
}
export function getCharacterRoutes(
@@ -52,9 +49,6 @@ export function getCharacterRoutes(
chat: `${root}/chat`,
privateRoom: `${root}/private-room`,
tip: `${root}/tip`,
sidebar: `${root}/sidebar`,
feedback: `${root}/feedback`,
coinsRules: `${root}/coins-rules`,
};
}
@@ -86,15 +80,15 @@ export const ROUTE_BUILDERS = {
options: {
payChannel?: PayChannel;
returnTo?: Exclude<AppSubscriptionReturnTo, null>;
characterSlug?: string;
sourceCharacterSlug?: string;
analytics?: PaymentAnalyticsContext;
} = {},
): `/subscription?${string}` => {
const params = new URLSearchParams({ type });
if (options.payChannel) params.set("payChannel", options.payChannel);
if (options.returnTo) params.set("returnTo", options.returnTo);
if (options.characterSlug) {
params.set("character", options.characterSlug);
if (options.sourceCharacterSlug) {
params.set("character", options.sourceCharacterSlug);
}
if (options.analytics) {
params.set(