mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
- 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
25 lines
622 B
TypeScript
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>
|
|
);
|
|
}
|