fix: 일정 관리 페이지 UI 수정
1. 외부 스크롤 제거 (h-screen overflow-hidden flex flex-col) 2. HTML 엔티티 디코딩 함수 추가 (< > 등 올바르게 표시) 3. decodeHtmlEntities 함수를 컴포넌트 외부로 이동하여 ScheduleItem에서 접근 가능
This commit is contained in:
parent
0f7d3d6f39
commit
04ce4beba4
1 changed files with 12 additions and 4 deletions
|
|
@ -18,6 +18,14 @@ import { getTodayKST, formatDate } from '../../../utils/date';
|
|||
import * as schedulesApi from '../../../api/admin/schedules';
|
||||
import * as categoriesApi from '../../../api/admin/categories';
|
||||
|
||||
// HTML 엔티티 디코딩 함수
|
||||
const decodeHtmlEntities = (text) => {
|
||||
if (!text) return '';
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.innerHTML = text;
|
||||
return textarea.value;
|
||||
};
|
||||
|
||||
// 일정 아이템 컴포넌트 - React.memo로 불필요한 리렌더링 방지
|
||||
const ScheduleItem = memo(function ScheduleItem({
|
||||
schedule,
|
||||
|
|
@ -58,7 +66,7 @@ const ScheduleItem = memo(function ScheduleItem({
|
|||
/>
|
||||
|
||||
<div className="flex-1 min-w-0">
|
||||
<h3 className="font-semibold text-gray-900">{schedule.title}</h3>
|
||||
<h3 className="font-semibold text-gray-900">{decodeHtmlEntities(schedule.title)}</h3>
|
||||
<div className="flex items-center gap-3 mt-1 text-sm text-gray-500">
|
||||
{schedule.time && (
|
||||
<span className="flex items-center gap-1">
|
||||
|
|
@ -564,7 +572,7 @@ function AdminSchedule() {
|
|||
}, [categories, categoryCounts]);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50">
|
||||
<div className="h-screen overflow-hidden bg-gray-50 flex flex-col">
|
||||
<Toast toast={toast} onClose={() => setToast(null)} />
|
||||
|
||||
{/* 삭제 확인 다이얼로그 */}
|
||||
|
|
@ -589,7 +597,7 @@ function AdminSchedule() {
|
|||
<AdminHeader user={user} />
|
||||
|
||||
{/* 메인 콘텐츠 */}
|
||||
<main className="max-w-7xl mx-auto px-6 py-8">
|
||||
<main className="flex-1 overflow-hidden max-w-7xl mx-auto px-6 py-8 w-full">
|
||||
{/* 브레드크럼 */}
|
||||
<div className="flex items-center gap-2 text-sm text-gray-400 mb-8">
|
||||
<Link to="/admin/dashboard" className="hover:text-primary transition-colors">
|
||||
|
|
@ -1103,7 +1111,7 @@ function AdminSchedule() {
|
|||
/>
|
||||
|
||||
<div className="flex-1 min-w-0">
|
||||
<h3 className="font-semibold text-gray-900">{schedule.title}</h3>
|
||||
<h3 className="font-semibold text-gray-900">{decodeHtmlEntities(schedule.title)}</h3>
|
||||
<div className="flex items-center gap-3 mt-1 text-sm text-gray-500">
|
||||
{schedule.time && (
|
||||
<span className="flex items-center gap-1">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue