fix(subscription): return to chat from paywall
This commit is contained in:
@@ -16,12 +16,16 @@ import styles from "./subscription-back-link.module.css";
|
|||||||
|
|
||||||
export interface SubscriptionBackLinkProps {
|
export interface SubscriptionBackLinkProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
href?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SubscriptionBackLink({ className }: SubscriptionBackLinkProps) {
|
export function SubscriptionBackLink({
|
||||||
|
className,
|
||||||
|
href = ROUTES.sidebar,
|
||||||
|
}: SubscriptionBackLinkProps) {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={ROUTES.sidebar}
|
href={href}
|
||||||
aria-label="Back"
|
aria-label="Back"
|
||||||
className={[styles.backLink, className].filter(Boolean).join(" ")}
|
className={[styles.backLink, className].filter(Boolean).join(" ")}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ export function SubscriptionScreen({
|
|||||||
payment.isPollingOrder;
|
payment.isPollingOrder;
|
||||||
const canActivate =
|
const canActivate =
|
||||||
selectedPlan !== null && payment.agreed && !isPaymentBusy;
|
selectedPlan !== null && payment.agreed && !isPaymentBusy;
|
||||||
|
const backHref = returnTo === "chat" ? ROUTES.chat : ROUTES.sidebar;
|
||||||
|
|
||||||
const finishPaymentSuccessClose = () => {
|
const finishPaymentSuccessClose = () => {
|
||||||
setShowPaymentSuccessDialog(false);
|
setShowPaymentSuccessDialog(false);
|
||||||
@@ -215,7 +216,7 @@ export function SubscriptionScreen({
|
|||||||
<MobileShell>
|
<MobileShell>
|
||||||
<div className={styles.shell}>
|
<div className={styles.shell}>
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<SubscriptionBackLink className={styles.backSlot} />
|
<SubscriptionBackLink className={styles.backSlot} href={backHref} />
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div className={styles.offerStack}>
|
<div className={styles.offerStack}>
|
||||||
|
|||||||
Reference in New Issue
Block a user