Files
opencode-manager/frontend/src/components/ui/back-button.tsx
T
Chris Scott 9d94c333b4 feat: add mobile swipe-back navigation and gestures
- Implement swipe-to-close for mobile modals and dialogs
- Add PageTransition component with push/pop animations
- Create navigation store for managing navigation state
- Add useNavigationDirection hook for animation direction
- Implement useSwipeToClose hook for swipe gestures
- Add prefers-reduced-motion accessibility support
- Create FileBrowserSheet component for mobile file browser
- Add comprehensive tests for swipe behavior and navigation
- Update FileBrowser, Dialog, and BackButton components
- Configure Vite for proper CSS handling
2026-04-15 12:44:33 -04:00

25 lines
622 B
TypeScript

import { useNavigate } from "react-router-dom";
import { ArrowLeft } from "lucide-react";
interface BackButtonProps {
to?: string;
className?: string;
}
export function BackButton({ to = "/", className = "" }: BackButtonProps) {
const navigate = useNavigate();
const handleBack = () => {
navigate(to);
};
return (
<button
onClick={handleBack}
className={`text-zinc-400 hover:text-zinc-100 transition-all duration-200 hover:scale-105 text-sm md:text-md border border-zinc-700 rounded-md px-3 py-1.5 hover ${className}`}
>
<ArrowLeft className="w-4 h-4" />
</button>
);
}