11import { useState } from 'react' ;
22import type { TodoData } from '../../types/todo' ;
3- import { getTodayDateString } from '../hooks/useTodos.ts' ; // 경로 맞게 수정
3+ import { getTodayDateString } from '../hooks/useTodos.ts' ;
44
55interface CalendarProps {
66 todos : TodoData ;
@@ -42,17 +42,17 @@ export const Calendar = ({
4242 const weekDays = [ '일' , '월' , '화' , '수' , '목' , '금' , '토' ] ;
4343
4444 return (
45- < div className = "border border-gray-200 rounded-lg p-5 bg-white shadow-sm" >
45+ < div className = "border border-gray-200 dark:border-none rounded-lg p-5 bg-white dark:bg-graybg dark:text-cream shadow-sm" >
4646 { /* 1. 헤더 영역 */ }
4747 < header className = "mb-6" >
48- < div className = "text-sm text-gray-500 mb-6" >
48+ < div className = "text-sm text-gray-500 dark:text-cream mb-6" >
4949 오늘: { today . getFullYear ( ) } 년 { today . getMonth ( ) + 1 } 월{ ' ' }
5050 { today . getDate ( ) } 일
5151 </ div >
5252 < div className = "flex justify-between items-center" >
5353 < button
5454 onClick = { handlePrevMonth }
55- className = "px-3 py-1 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors cursor-pointer"
55+ className = "px-3 py-1 bg-gray-100 dark:bg-darkbg rounded-md hover:bg-gray-200 transition-colors cursor-pointer"
5656 >
5757 <
5858 </ button >
@@ -61,7 +61,7 @@ export const Calendar = ({
6161 </ h2 >
6262 < button
6363 onClick = { handleNextMonth }
64- className = "px-3 py-1 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors cursor-pointer"
64+ className = "px-3 py-1 bg-gray-100 dark:bg-darkbg rounded-md hover:bg-gray-200 transition-colors cursor-pointer"
6565 >
6666 >
6767 </ button >
@@ -73,7 +73,15 @@ export const Calendar = ({
7373 { weekDays . map ( ( day ) => (
7474 < div
7575 key = { day }
76- className = { `font-semibold py-2 ${ day === '일' ? 'text-red-600' : day === '토' ? 'text-blue-600' : 'text-gray-600' } ` }
76+ className = { `font-semibold py-2
77+ ${
78+ day === '일'
79+ ? 'text-red-600 dark:text-red-400'
80+ : day === '토'
81+ ? 'text-blue-600 dark:text-blue-400'
82+ : 'text-gray-600 dark:text-gray-300'
83+ }
84+ ` }
7785 >
7886 { day }
7987 </ div >
@@ -96,34 +104,41 @@ export const Calendar = ({
96104 const incompleteCount = dayTodos . filter (
97105 ( todo ) => ! todo . isCompleted
98106 ) . length ;
107+ const completedCount = dayTodos . length - incompleteCount ;
99108
100109 return (
101110 < div
102111 key = { dateString }
103112 onClick = { ( ) => setSelectedDate ( dateString ) }
104113 className = { `
105- min-h-[80px] p-2 rounded-md flex flex-col items-center cursor-pointer transition-all border
114+ min-h-[80px] p-2 rounded-md flex flex-col items-center cursor-pointer transition-all dark:text-white border border-px dark:border-gray-600
106115 ${
107116 isSelected
108- ? 'border-blue-500 bg-blue-50 ring-1 ring-blue-500'
109- : 'border-gray-100 hover:bg-gray-50'
117+ ? 'border-blue-500 dark:border-deepBlue bg-blue-50 dark:bg-deepBlue ring-1 ring-blue-500'
118+ : 'border-gray-100 hover:bg-gray-50 dark:hover:bg-deepBlue '
110119 }
111120 ` }
112121 >
113122 < div
114- className = { `font-medium ${ isToday ? 'text-midBlue' : 'text-gray-800' } ` }
123+ className = { `font-medium dark:text-white ${ isToday ? 'text-midBlue' : 'text-gray-800' } ` }
115124 >
116125 { day }
117126 </ div >
118127
119128 { isToday && (
120- < span className = "text-[10px] font-bold text-midBlue leading-none mt-1" >
129+ < span className = "text-[10px] font-bold text-midBlue leading-none mt-1 mb-1 " >
121130 today
122131 </ span >
123132 ) }
124133
134+ { completedCount > 0 && (
135+ < div className = "text-xs text-deepBlue font-medium" >
136+ 완료: { completedCount }
137+ </ div >
138+ ) }
139+
125140 { incompleteCount > 0 && (
126- < div className = "text-xs text-deepBlue font-medium mt-auto mb-1 " >
141+ < div className = "text-xs text-deepBlue font-medium" >
127142 미완료: { incompleteCount }
128143 </ div >
129144 ) }
0 commit comments