mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
- 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
33 lines
794 B
TypeScript
33 lines
794 B
TypeScript
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>
|
|
);
|
|
}
|