mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
- Wrap /connection/qr route in ProtectedRoute with Layout - Remove fullscreen overlay and custom close button - Add AdminBackButton with replace prop to avoid history cycles - Use replace navigation from Connection to QR page - Add replace prop support to AdminBackButton component
36 lines
854 B
TypeScript
36 lines
854 B
TypeScript
import { Link } from 'react-router';
|
|
import { usePlatform } from '@/platform';
|
|
import { BackIcon } from './icons';
|
|
|
|
interface AdminBackButtonProps {
|
|
to?: string;
|
|
replace?: boolean;
|
|
className?: string;
|
|
}
|
|
|
|
/**
|
|
* Back button for admin pages.
|
|
* Hidden in Telegram Mini App since native back button is used instead.
|
|
*/
|
|
export function AdminBackButton({ to = '/admin', replace, className }: AdminBackButtonProps) {
|
|
const { platform } = usePlatform();
|
|
|
|
// In Telegram Mini App, we use native back button
|
|
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>
|
|
);
|
|
}
|