feat: 모바일 하단 내비게이션·설정 패널 도입
This commit is contained in:
1 parent
bb0ab91bcc
commit
54e5d14127
11 files changed
+613
-375
No files matched your search
@@ -67,16 +67,17 @@ const statusLabelKey = (status: UploadStatus) => {
|
||||
|
||||
interface ContentCalendarContentProps {
|
||||
onNavigate?: (id: string) => void;
|
||||
/** 내 정보 탭 안에 임베드될 때: 탭 라벨과 중복되는 자체 제목을 숨기고 여백을 줄인다 */
|
||||
embedded?: boolean;
|
||||
}
|
||||
|
||||
const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavigate }) => {
|
||||
const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavigate, embedded }) => {
|
||||
const { t } = useTranslation();
|
||||
const today = new Date();
|
||||
const [year, setYear] = useState(today.getFullYear());
|
||||
const [month, setMonth] = useState(today.getMonth());
|
||||
const [activeTab, setActiveTab] = useState<TabType>('전체');
|
||||
const [isMobile, setIsMobile] = useState(window.innerWidth < MOBILE_BREAKPOINT);
|
||||
const [sheetOpen, setSheetOpen] = useState(false);
|
||||
// allItems: 캘린더 도트용 (전체)
|
||||
// panelItems: 오른쪽 패널용 (탭 필터)
|
||||
const [allItems, setAllItems] = useState<UploadHistoryItem[]>([]);
|
||||
@@ -194,11 +195,16 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
setTimeout(() => {
|
||||
const el = dateRefs.current[dateKey];
|
||||
const panel = panelRef.current;
|
||||
if (el && panel) {
|
||||
if (!el) return;
|
||||
// 패널이 자체 스크롤을 가진 경우(데스크톱 사이드 패널)만 내부 스크롤.
|
||||
// 모바일은 목록이 캘린더 아래에 그대로 펼쳐지므로 페이지 스크롤로 이동한다.
|
||||
if (panel && panel.scrollHeight > panel.clientHeight) {
|
||||
const panelTop = panel.getBoundingClientRect().top;
|
||||
const elTop = el.getBoundingClientRect().top;
|
||||
const offset = elTop - panelTop + panel.scrollTop - 12; // 12px 여백
|
||||
panel.scrollTo({ top: offset, behavior: 'smooth' });
|
||||
} else {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}, 50);
|
||||
};
|
||||
@@ -616,10 +622,11 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
};
|
||||
|
||||
// ── 패널 콘텐츠 ────────────────────────────────────────────
|
||||
const renderPanelContent = () => {
|
||||
// inline=true (모바일): 자체 스크롤 없이 페이지 흐름에 그대로 펼친다
|
||||
const renderPanelContent = (inline = false) => {
|
||||
if (panelLoading) {
|
||||
return (
|
||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: inline ? 120 : undefined }}>
|
||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>{t('contentCalendar.loading')}</span>
|
||||
</div>
|
||||
);
|
||||
@@ -629,6 +636,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
<div style={{
|
||||
flex: 1, display: 'flex', flexDirection: 'column',
|
||||
alignItems: 'center', justifyContent: 'center', gap: 24, padding: 16,
|
||||
minHeight: inline ? 160 : undefined,
|
||||
}}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, alignItems: 'center', textAlign: 'center' }}>
|
||||
<p style={{
|
||||
@@ -662,7 +670,11 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
<div
|
||||
ref={panelRef}
|
||||
className="calendar-panel-scroll"
|
||||
style={{ flex: 1, overflowY: 'auto', padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20, maxHeight: 700 }}
|
||||
style={{
|
||||
flex: 1, padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20,
|
||||
overflowY: inline ? 'visible' : 'auto',
|
||||
maxHeight: inline ? undefined : 700,
|
||||
}}
|
||||
>
|
||||
{sortedDateKeys.map(dateKey => (
|
||||
<div
|
||||
@@ -716,34 +728,24 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
{renderCalendarGrid()}
|
||||
</div>
|
||||
|
||||
{/* 바텀시트 */}
|
||||
<div style={{ position: 'fixed', bottom: 0, left: 0, right: 0, zIndex: 10, display: 'flex', flexDirection: 'column' }}>
|
||||
{/* 업로드 목록 — 캘린더 바로 아래에 펼쳐 둔다(바텀시트로 감추지 않음).
|
||||
좌우 여백 없음: 위 캘린더 그리드와 가로 폭을 맞춘다 */}
|
||||
<div style={{ width: '100%', marginTop: 16, boxSizing: 'border-box' }}>
|
||||
<div style={{
|
||||
backgroundColor: '#01393b',
|
||||
borderTop: '1px solid #046266',
|
||||
borderRadius: '20px 20px 0 0',
|
||||
border: '1px solid #046266',
|
||||
borderRadius: 20,
|
||||
overflow: 'hidden',
|
||||
}}>
|
||||
<div
|
||||
onClick={() => setSheetOpen(o => !o)}
|
||||
style={{ display: 'flex', justifyContent: 'center', padding: '8px 0', cursor: 'pointer' }}
|
||||
>
|
||||
<div style={{ width: 49, height: 4, backgroundColor: '#9bcacc', borderRadius: 999 }} />
|
||||
</div>
|
||||
<div style={{
|
||||
borderBottom: sheetOpen ? '1px solid #046266' : 'none',
|
||||
borderBottom: '1px solid #046266',
|
||||
height: 50, display: 'flex', alignItems: 'center', padding: '0 16px',
|
||||
}}>
|
||||
{renderTabs()}
|
||||
</div>
|
||||
{sheetOpen && (
|
||||
<div style={{ height: 400, overflowY: 'auto', backgroundColor: '#01393b', display: 'flex', flexDirection: 'column' }}>
|
||||
{renderPanelContent()}
|
||||
</div>
|
||||
)}
|
||||
{renderPanelContent(true)}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ height: sheetOpen ? 516 : 116 }} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -754,26 +756,28 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
||||
return (
|
||||
<div style={{
|
||||
display: 'flex', flexDirection: 'column', alignItems: 'center',
|
||||
padding: '32px',
|
||||
padding: embedded ? '0' : '32px',
|
||||
width: '100%',
|
||||
minWidth: 1400,
|
||||
height: '100%', boxSizing: 'border-box',
|
||||
height: embedded ? 'auto' : '100%', boxSizing: 'border-box',
|
||||
}}>
|
||||
<div style={{ width: '100%', maxWidth: 1440, paddingBottom: 32, flexShrink: 0 }}>
|
||||
<p style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
{!embedded && (
|
||||
<div style={{ width: '100%', maxWidth: 1440, paddingBottom: 32, flexShrink: 0 }}>
|
||||
<p style={{
|
||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||
}}>
|
||||
{t('contentCalendar.title')}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 340px',
|
||||
gap: 16,
|
||||
width: '100%', maxWidth: 1440,
|
||||
flex: 1, minHeight: 0,
|
||||
flex: 1, minHeight: embedded ? 'calc(100vh - 220px)' : 0,
|
||||
}}>
|
||||
{/* 캘린더 영역 */}
|
||||
<div className="calendar-grid-area" style={{
|
||||
|
||||
Reference in new issue
Block a user