fix(subscription): return to chat from paywall

This commit is contained in:
2026-06-30 10:17:29 +08:00
parent 089871af3e
commit 374aaa8c64
2 changed files with 8 additions and 3 deletions
@@ -16,12 +16,16 @@ import styles from "./subscription-back-link.module.css";
export interface SubscriptionBackLinkProps {
className?: string;
href?: string;
}
export function SubscriptionBackLink({ className }: SubscriptionBackLinkProps) {
export function SubscriptionBackLink({
className,
href = ROUTES.sidebar,
}: SubscriptionBackLinkProps) {
return (
<Link
href={ROUTES.sidebar}
href={href}
aria-label="Back"
className={[styles.backLink, className].filter(Boolean).join(" ")}
>
+2 -1
View File
@@ -156,6 +156,7 @@ export function SubscriptionScreen({
payment.isPollingOrder;
const canActivate =
selectedPlan !== null && payment.agreed && !isPaymentBusy;
const backHref = returnTo === "chat" ? ROUTES.chat : ROUTES.sidebar;
const finishPaymentSuccessClose = () => {
setShowPaymentSuccessDialog(false);
@@ -215,7 +216,7 @@ export function SubscriptionScreen({
<MobileShell>
<div className={styles.shell}>
<header className={styles.header}>
<SubscriptionBackLink className={styles.backSlot} />
<SubscriptionBackLink className={styles.backSlot} href={backHref} />
</header>
<div className={styles.offerStack}>