diff --git a/app/(my)/teamAlarm.tsx b/app/(my)/teamAlarm.tsx index 14c2369..8cf015e 100644 --- a/app/(my)/teamAlarm.tsx +++ b/app/(my)/teamAlarm.tsx @@ -135,6 +135,7 @@ const TeamAlarm = ({}: TeamAlarmProps) => { const handlePressTeam = (teamId: number) => () => { const team = teamLists.find((t) => t.teamId === teamId); if (!team) return; + animateIcon(!isOpenTeamList ? 1 : 0); setCurrentTeam(team); setSettings(null); // 새로운 팀 선택 시 이전 설정 초기화 (로딩 표시 유도) diff --git a/package.json b/package.json index ecb3749..58f3bba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nemonemo", "main": "expo-router/entry", - "version": "1.0.0", + "version": "1.0.1", "scripts": { "start": "expo start", "reset-project": "node ./scripts/reset-project.js", diff --git a/shared/ui/molecules/CalendarWeek.tsx b/shared/ui/molecules/CalendarWeek.tsx index 05030de..081a832 100644 --- a/shared/ui/molecules/CalendarWeek.tsx +++ b/shared/ui/molecules/CalendarWeek.tsx @@ -1,7 +1,7 @@ import { CalendarContext } from "@/shared/hooks/useCalendarAPI"; import { CalendarDate, CalendarSchedule } from "@/shared/types/Calendar"; import getWeekSchedules from "@/shared/utils/getWeekSchedules"; -import { useContext } from "react"; +import { useContext, useRef } from "react"; import { GestureResponderEvent, Pressable, @@ -49,6 +49,7 @@ const packSchedulesIntoLanes = (items: ReturnType) => { const LANE_HEIGHT = 16; const LANE_GAP = 4; const DATES_HEIGHT = 18; +const DOUBLE_TAP_DELAY_MS = 280; /* ---------- props ---------- */ interface CalendarSchedulesProps { @@ -81,18 +82,40 @@ const CalendarWeek = ({ const { selectedDate } = calendarContext; const MAX_LANES = height > 1200 ? maxLanes + 2 : maxLanes; const totalHeight = DATES_HEIGHT + MAX_LANES * (LANE_HEIGHT + LANE_GAP); + const lastTapRef = useRef<{ time: number; index: number } | null>(null); const handleWeekPress = (event: GestureResponderEvent) => { const { locationX } = event.nativeEvent; - const index = Math.floor(locationX / DAY_WIDTH); - onSelectDate?.(dates[index].fullDate); + const index = Math.min(6, Math.max(0, Math.floor(locationX / DAY_WIDTH))); + const tappedDate = dates[index].fullDate; + const now = Date.now(); + const lastTap = lastTapRef.current; + + onSelectDate?.(tappedDate); + + if (isSameDay(tappedDate, selectedDate)) { + onLongSelectDate?.(); + lastTapRef.current = null; + return; + } + + if ( + lastTap && + now - lastTap.time <= DOUBLE_TAP_DELAY_MS && + lastTap.index === index + ) { + onLongSelectDate?.(); + lastTapRef.current = null; + return; + } + + lastTapRef.current = { time: now, index }; }; return ( - + @@ -135,7 +135,9 @@ const CalendarDetailModal = ({ - + setIsOpenTeamList(false)} > - + item.teamId.toString()} @@ -503,6 +503,17 @@ const style = StyleSheet.create({ alignItems: "center", paddingBottom: 40, }, + teamModalContainer: { + width: "90%", + backgroundColor: globalGray0, + borderRadius: globalSpacingSm, + overflow: "hidden", + shadowColor: "#000", + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.25, + shadowRadius: 3.84, + elevation: 5, + }, modalContainer: { height: "90%", backgroundColor: globalGray0,