fix(haptics): restore haptic feedback to MobileBackButton (#198)

## Summary

- Restores `useWebHaptics` import and `trigger('light')` call to
`MobileBackButton` that was lost during rebase
- Both the floating and inline back buttons now fire haptic feedback on
tap via the shared `handleBack` function
This commit is contained in:
Víctor Falcón 2026-03-03 21:40:50 +00:00 committed by GitHub
parent 3d742677b5
commit fdc9d14c47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import { cn } from '@/lib/utils';
import { router } from '@inertiajs/react';
import { ArrowLeft } from 'lucide-react';
import { useEffect, useState } from 'react';
import { useWebHaptics } from 'web-haptics/react';
interface Props {
href: string;
@ -10,6 +11,7 @@ interface Props {
export function MobileBackButton({ href, className }: Props) {
const [isScrolled, setIsScrolled] = useState(false);
const { trigger } = useWebHaptics();
useEffect(() => {
function handleScroll() {
@ -23,6 +25,7 @@ export function MobileBackButton({ href, className }: Props) {
}, []);
function handleBack() {
trigger('light');
router.visit(href);
}