Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/(my)/teamAlarm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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); // 새로운 팀 선택 시 이전 설정 초기화 (로딩 표시 유도)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
31 changes: 27 additions & 4 deletions shared/ui/molecules/CalendarWeek.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -49,6 +49,7 @@ const packSchedulesIntoLanes = (items: ReturnType<typeof getWeekSchedules>) => {
const LANE_HEIGHT = 16;
const LANE_GAP = 4;
const DATES_HEIGHT = 18;
const DOUBLE_TAP_DELAY_MS = 280;

/* ---------- props ---------- */
interface CalendarSchedulesProps {
Expand Down Expand Up @@ -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 (
<Pressable
style={{ height: totalHeight, width: WEEK_WIDTH }}
onPress={handleWeekPress}
onLongPress={onLongSelectDate}
>
<View pointerEvents="none" style={styles.weekInner}>
<CalendarWeekDates
Expand Down
6 changes: 4 additions & 2 deletions shared/ui/templates/CalendarDetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const CalendarDetailModal = ({
return (
<Modal transparent animationType="slide" onRequestClose={closeModal}>
<View style={styles.backdrop}>
<BottomModal.Container style={{ minHeight: 660 }}>
<BottomModal.Container style={{ height: "90%" }}>
<BottomModal.Header {...indicatorHandlers}>
<BottomModal.LeftButton onPress={handleDeleteButton}>
<Ionicons name="trash-outline" size={20} color={globalGray700} />
Expand All @@ -135,7 +135,9 @@ const CalendarDetailModal = ({
</BottomModal.RightButton>
</BottomModal.Header>
<View>
<View style={styles.row}>
<View
style={[styles.row, { marginVertical: 16, paddingHorizontal: 8 }]}
>
<View
style={{
backgroundColor: data.representativeColorHex ?? "#BDBDBD",
Expand Down
13 changes: 12 additions & 1 deletion shared/ui/templates/CalendarModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ const CalendarModal = ({
style={style.modalBackdrop}
onPress={() => setIsOpenTeamList(false)}
>
<View style={style.modalContainer}>
<View style={style.teamModalContainer}>
<FlatList
data={teamLists}
keyExtractor={(item) => item.teamId.toString()}
Expand Down Expand Up @@ -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,
Expand Down