feat: 검색 카드 날짜 레이아웃 개선

- 왼쪽에 날짜 세로 배치 (년도/월.일/요일)
- 일요일 빨간색, 토요일 파란색 요일 색상 적용
- 오른쪽 콘텐츠 영역으로 분리
This commit is contained in:
caadiq 2026-01-10 10:35:00 +09:00
parent 54fe3074dc
commit 3b79aa13c2

View file

@ -591,17 +591,22 @@ function ScheduleCard({ schedule, categoryColor, categories, delay = 0 }) {
const memberNames = schedule.member_names || schedule.members?.map(m => m.name).join(',') || ''; const memberNames = schedule.member_names || schedule.members?.map(m => m.name).join(',') || '';
const memberList = memberNames.split(',').filter(name => name.trim()); const memberList = memberNames.split(',').filter(name => name.trim());
// //
const formatDate = (dateStr) => { const parseDate = (dateStr) => {
if (!dateStr) return ''; if (!dateStr) return null;
const date = new Date(dateStr); const date = new Date(dateStr);
const year = date.getFullYear();
const month = date.getMonth() + 1; const month = date.getMonth() + 1;
const day = date.getDate(); const day = date.getDate();
const weekdays = ['일', '월', '화', '수', '목', '금', '토']; const weekdays = ['일', '월', '화', '수', '목', '금', '토'];
const weekday = weekdays[date.getDay()]; const weekday = weekdays[date.getDay()];
return `${month}.${day} (${weekday})`; const isWeekend = date.getDay() === 0 || date.getDay() === 6;
const isSunday = date.getDay() === 0;
return { year, month, day, weekday, isWeekend, isSunday };
}; };
const dateInfo = parseDate(schedule.date);
return ( return (
<motion.div <motion.div
initial={{ opacity: 0, y: 10 }} initial={{ opacity: 0, y: 10 }}
@ -610,15 +615,25 @@ function ScheduleCard({ schedule, categoryColor, categories, delay = 0 }) {
> >
{/* 카드 본체 */} {/* 카드 본체 */}
<div className="relative bg-white rounded-md shadow-[0_2px_12px_rgba(0,0,0,0.06)] border border-gray-100/50 overflow-hidden"> <div className="relative bg-white rounded-md shadow-[0_2px_12px_rgba(0,0,0,0.06)] border border-gray-100/50 overflow-hidden">
<div className="p-4"> <div className="flex">
{/* 왼쪽 날짜 영역 */}
{/* 날짜 및 시간 뱃지 */} {dateInfo && (
<div className="flex items-center gap-1.5 mb-2 flex-wrap"> <div className="flex-shrink-0 w-16 py-3 px-2 bg-gray-50 border-r border-gray-100 flex flex-col items-center justify-center">
{/* 날짜 뱃지 */} <span className="text-[10px] text-gray-400">{dateInfo.year}</span>
<div className="px-2 py-0.5 bg-gray-100 rounded-full text-xs font-medium text-gray-600"> <span className="text-lg font-bold text-gray-800">{dateInfo.month}.{dateInfo.day}</span>
{formatDate(schedule.date)} <span className={`text-[11px] font-medium ${
dateInfo.isSunday ? 'text-red-500' :
dateInfo.isWeekend ? 'text-blue-500' : 'text-gray-500'
}`}>
{dateInfo.weekday}요일
</span>
</div> </div>
{/* 시간 뱃지 */} )}
{/* 오른쪽 콘텐츠 영역 */}
<div className="flex-1 p-4 min-w-0">
{/* 시간 및 카테고리 뱃지 */}
<div className="flex items-center gap-1.5 mb-2 flex-wrap">
{schedule.time && ( {schedule.time && (
<div <div
className="flex items-center gap-1 px-2 py-0.5 rounded-full text-white text-xs font-medium" className="flex items-center gap-1 px-2 py-0.5 rounded-full text-white text-xs font-medium"
@ -628,7 +643,6 @@ function ScheduleCard({ schedule, categoryColor, categories, delay = 0 }) {
{schedule.time.slice(0, 5)} {schedule.time.slice(0, 5)}
</div> </div>
)} )}
{/* 카테고리 뱃지 */}
<span <span
className="px-2 py-0.5 rounded-full text-xs font-medium" className="px-2 py-0.5 rounded-full text-xs font-medium"
style={{ style={{
@ -674,6 +688,7 @@ function ScheduleCard({ schedule, categoryColor, categories, delay = 0 }) {
)} )}
</div> </div>
</div> </div>
</div>
</motion.div> </motion.div>
); );
} }