feat: add WebBackButton to all sub-pages, widen renew page layout

- New WebBackButton component: visible on web, hidden in Telegram
  (native back button handles navigation there)
- Added to: Subscription detail, SubscriptionPurchase, RenewSubscription
- RenewSubscription: removed max-w-lg, grid layout for period cards
This commit is contained in:
c0mrade
2026-03-24 14:01:55 +03:00
parent f1cb9e5c66
commit 31d0953c23
4 changed files with 73 additions and 27 deletions

View File

@@ -0,0 +1,32 @@
import { Link } from 'react-router';
import { usePlatform } from '../platform';
import { BackIcon } from './icons';
interface WebBackButtonProps {
to: string;
replace?: boolean;
className?: string;
}
/**
* Back button visible only on web platform.
* Hidden in Telegram Mini App — native back button handles navigation there.
*/
export function WebBackButton({ to, replace, className }: WebBackButtonProps) {
const { platform } = usePlatform();
if (platform === 'telegram') return null;
return (
<Link
to={to}
replace={replace}
className={
className ||
'flex h-10 w-10 items-center justify-center rounded-xl border border-dark-700 bg-dark-800 transition-colors hover:border-dark-600'
}
>
<BackIcon />
</Link>
);
}