refactor: remove haptic feedback triggers from calendar and duty components
- Eliminated triggerHapticLight calls from CalendarPage, CalendarDay, DayDetail, and DutyTimelineCard components to streamline user interaction. - This change focuses on improving performance and reducing unnecessary feedback in the user interface.
This commit is contained in:
@@ -17,7 +17,6 @@ import { CalendarGrid } from "@/components/calendar/CalendarGrid";
|
||||
import { DutyList } from "@/components/duty/DutyList";
|
||||
import { DayDetail, type DayDetailHandle } from "@/components/day-detail";
|
||||
import { ErrorState } from "@/components/states/ErrorState";
|
||||
import { triggerHapticLight } from "@/lib/telegram-haptic";
|
||||
|
||||
/** Fallback height (px) until ResizeObserver reports the sticky block size. Matches --calendar-block-min-height + pb-2 (260 + 8). */
|
||||
const STICKY_HEIGHT_FALLBACK_PX = 268;
|
||||
@@ -91,12 +90,10 @@ export function CalendarPage({ isAllowed, initDataRaw }: CalendarPageProps) {
|
||||
const navDisabled = loading || accessDenied || selectedDay !== null;
|
||||
const handlePrevMonth = useCallback(() => {
|
||||
if (navDisabled) return;
|
||||
triggerHapticLight();
|
||||
prevMonth();
|
||||
}, [navDisabled, prevMonth]);
|
||||
const handleNextMonth = useCallback(() => {
|
||||
if (navDisabled) return;
|
||||
triggerHapticLight();
|
||||
nextMonth();
|
||||
}, [navDisabled, nextMonth]);
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import React, { useMemo } from "react";
|
||||
import { useTranslation } from "@/i18n/use-translation";
|
||||
import { dateKeyToDDMM } from "@/lib/date-utils";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { triggerHapticLight } from "@/lib/telegram-haptic";
|
||||
import type { DutyWithUser } from "@/types";
|
||||
import { DayIndicators } from "./DayIndicators";
|
||||
|
||||
@@ -90,7 +89,6 @@ function CalendarDayInner({
|
||||
)}
|
||||
onClick={(e) => {
|
||||
if (isOtherMonth) return;
|
||||
triggerHapticLight();
|
||||
onDayClick(dateKey, e.currentTarget.getBoundingClientRect());
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -27,7 +27,6 @@ import { DayDetailContent } from "./DayDetailContent";
|
||||
import type { CalendarEvent, DutyWithUser } from "@/types";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useAppStore } from "@/store/app-store";
|
||||
import { triggerHapticLight } from "@/lib/telegram-haptic";
|
||||
|
||||
/** Empty state for day detail: date and "no duties or events" message. */
|
||||
function DayDetailEmpty({ dateKey }: { dateKey: string }) {
|
||||
@@ -121,7 +120,6 @@ export const DayDetail = React.forwardRef<DayDetailHandle, DayDetailProps>(
|
||||
|
||||
/** Start close animation; actual unmount happens in onCloseAnimationEnd (or fallback timeout). */
|
||||
const requestClose = React.useCallback(() => {
|
||||
triggerHapticLight();
|
||||
setExiting(true);
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
formatHHMM,
|
||||
} from "@/lib/date-utils";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { triggerHapticLight } from "@/lib/telegram-haptic";
|
||||
import { ContactLinks } from "@/components/contact/ContactLinks";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import type { DutyWithUser } from "@/types";
|
||||
@@ -78,7 +77,6 @@ export function DutyTimelineCard({
|
||||
const flipped = isControlled ? (isFlipped ?? false) : localFlipped;
|
||||
|
||||
const handleFlipToBack = () => {
|
||||
triggerHapticLight();
|
||||
if (isControlled) {
|
||||
onFlipChange?.(true);
|
||||
} else {
|
||||
@@ -88,7 +86,6 @@ export function DutyTimelineCard({
|
||||
};
|
||||
|
||||
const handleFlipToFront = () => {
|
||||
triggerHapticLight();
|
||||
if (isControlled) {
|
||||
onFlipChange?.(false);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user