mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
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:
32
src/components/WebBackButton.tsx
Normal file
32
src/components/WebBackButton.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user