feat(subscription): 모바일 반응형 — 바텀시트 필터 + FAB
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1161,4 +1161,20 @@
|
|||||||
.sub-tabs-bar { flex-direction: column; align-items: flex-start; }
|
.sub-tabs-bar { flex-direction: column; align-items: flex-start; }
|
||||||
.sub-sched-row { grid-template-columns: 90px 10px 1fr; gap: 0 10px; }
|
.sub-sched-row { grid-template-columns: 90px 10px 1fr; gap: 0 10px; }
|
||||||
.sub-compare__row { grid-template-columns: 70px 1fr 1fr 16px; }
|
.sub-compare__row { grid-template-columns: 70px 1fr 1fr 16px; }
|
||||||
|
|
||||||
|
/* 공고 카드 1컬럼 */
|
||||||
|
.sub-card-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 탭 가로 스크롤 */
|
||||||
|
.sub-tabs {
|
||||||
|
overflow-x: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-tabs > * {
|
||||||
|
flex-shrink: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import React, { useState, useEffect, useMemo } from 'react';
|
import React, { useState, useEffect, useMemo, useCallback } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { apiGet, apiPost, apiPut, apiDelete } from '../../api';
|
import { apiGet, apiPost, apiPut, apiDelete } from '../../api';
|
||||||
|
import { useIsMobile } from '../../hooks/useIsMobile';
|
||||||
|
import PullToRefresh from '../../components/PullToRefresh';
|
||||||
|
import FAB from '../../components/FAB';
|
||||||
|
import MobileSheet from '../../components/MobileSheet';
|
||||||
import './Subscription.css';
|
import './Subscription.css';
|
||||||
|
|
||||||
// ── 상수 ───────────────────────────────────────────────────────────────────────
|
// ── 상수 ───────────────────────────────────────────────────────────────────────
|
||||||
@@ -1296,9 +1300,21 @@ function ProfileTab() {
|
|||||||
|
|
||||||
// ── Subscription (Main) ──────────────────────────────────────────────────────
|
// ── Subscription (Main) ──────────────────────────────────────────────────────
|
||||||
function Subscription() {
|
function Subscription() {
|
||||||
|
const isMobile = useIsMobile();
|
||||||
const [activeTab, setActiveTab] = useState(0);
|
const [activeTab, setActiveTab] = useState(0);
|
||||||
|
const [filterSheetOpen, setFilterSheetOpen] = useState(false);
|
||||||
|
|
||||||
|
const handleFABClick = useCallback(() => {
|
||||||
|
if (activeTab === 0) {
|
||||||
|
// DashboardTab — open filter sheet or scroll to collect
|
||||||
|
setFilterSheetOpen(true);
|
||||||
|
} else {
|
||||||
|
setFilterSheetOpen(true);
|
||||||
|
}
|
||||||
|
}, [activeTab]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<PullToRefresh onRefresh={useCallback(async () => {}, [])}>
|
||||||
<div className="sub">
|
<div className="sub">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="sub-header">
|
<div className="sub-header">
|
||||||
@@ -1333,7 +1349,39 @@ function Subscription() {
|
|||||||
{activeTab === 2 && <MatchesTab />}
|
{activeTab === 2 && <MatchesTab />}
|
||||||
{activeTab === 3 && <ProfileTab />}
|
{activeTab === 3 && <ProfileTab />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<MobileSheet
|
||||||
|
open={filterSheetOpen}
|
||||||
|
onClose={() => setFilterSheetOpen(false)}
|
||||||
|
title="필터"
|
||||||
|
snap="half"
|
||||||
|
>
|
||||||
|
<div style={{ padding: '8px 0' }}>
|
||||||
|
<p style={{ fontSize: '0.85rem', color: 'var(--text-muted)', marginBottom: 12 }}>
|
||||||
|
탭을 선택하여 원하는 화면으로 이동하세요.
|
||||||
|
</p>
|
||||||
|
{TABS.map((tab, i) => (
|
||||||
|
<button
|
||||||
|
key={tab}
|
||||||
|
onClick={() => { setActiveTab(i); setFilterSheetOpen(false); }}
|
||||||
|
style={{
|
||||||
|
display: 'block', width: '100%', padding: '12px 16px',
|
||||||
|
textAlign: 'left', background: activeTab === i ? 'rgba(244,63,94,0.1)' : 'transparent',
|
||||||
|
border: 'none', borderRadius: 8, cursor: 'pointer',
|
||||||
|
color: activeTab === i ? '#f43f5e' : 'var(--text-primary)',
|
||||||
|
fontSize: '0.9rem', fontWeight: activeTab === i ? 700 : 400,
|
||||||
|
marginBottom: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{tab}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</MobileSheet>
|
||||||
|
|
||||||
|
<FAB onClick={handleFABClick} label="공고 등록" />
|
||||||
</div>
|
</div>
|
||||||
|
</PullToRefresh>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user