From 754d81139e6603705f53e1520feef3f0c149e4d7 Mon Sep 17 00:00:00 2001 From: gahusb Date: Tue, 28 Apr 2026 03:58:34 +0900 Subject: [PATCH] =?UTF-8?q?feat(mypage):=20hero=20=EC=B6=95=EC=86=8C=20+?= =?UTF-8?q?=20"=EA=B5=AC=EB=A7=A4=ED=95=9C=20=ED=8C=A9"=20=ED=83=AD=20?= =?UTF-8?q?=EC=8B=A0=EC=84=A4=20+=20=EB=B9=A0=EB=A5=B8=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20AI=20=EC=8A=A4=ED=8A=9C=EB=94=94=EC=98=A4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hero: bg-[#04102b] → kx-surface, py-10→py-8, 아바타 보라 액센트, 가입일 톤 다운, 로그아웃 버튼 제거 (TopNav가 담당) - Tab type에 'packs' 추가, 결제 내역 다음 위치에 "구매한 팩" 탭 - packOrders 계산: orders.service 에서 extractPackTier로 Music 팩만 필터 - 신규 탭 JSX: status별 분기(완료/처리중/대기) + 자료 리스트 + 비활성 다운로드 버튼 + 카톡 안내. Phase 2에서 다운로드 활성화 예정 - 빠른 메뉴: AI 스튜디오 카드 1개 추가 (사주·외주 옆), grid-cols-2→sm:grid-cols-3 - 탭 컨테이너 flex-wrap 적용 (모바일 7개 wrap) - handleLogout 함수 제거 (사용처 없어짐) Co-Authored-By: Claude Opus 4.7 (1M context) --- app/mypage/page.tsx | 137 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 114 insertions(+), 23 deletions(-) diff --git a/app/mypage/page.tsx b/app/mypage/page.tsx index b878bc9..46b5f26 100644 --- a/app/mypage/page.tsx +++ b/app/mypage/page.tsx @@ -6,6 +6,7 @@ import Link from 'next/link'; import { createClient } from '@/lib/supabase/client'; import type { User } from '@supabase/supabase-js'; import TelegramGuideModal from '@/app/components/TelegramGuideModal'; +import { PACK_ASSETS, extractPackTier, type PackTier } from '@/lib/pack-assets'; function buildSajuResultUrl(rec: SajuRecord) { const { birth_year, birth_month, birth_day, birth_hour, gender } = rec.saju_data; @@ -15,7 +16,7 @@ function buildSajuResultUrl(rec: SajuRecord) { return url; } -type Tab = 'profile' | 'projects' | 'subscription' | 'saju' | 'payments' | 'orders'; +type Tab = 'profile' | 'projects' | 'subscription' | 'saju' | 'payments' | 'orders' | 'packs'; type TelegramLinkState = 'idle' | 'generating' | 'waiting' | 'disconnecting'; interface SajuRecord { @@ -162,12 +163,6 @@ export default function MyPage() { init(); }, []); - const handleLogout = async () => { - await supabase.auth.signOut(); - router.push('/'); - router.refresh(); - }; - // ── 구독 해지 ── const handleCancelSubscription = async (subId: string) => { if (!confirm('구독을 해지하시겠습니까?\n만료일까지는 서비스를 계속 이용할 수 있습니다.')) return; @@ -283,10 +278,15 @@ export default function MyPage() { const activeSubs = activeSubscriptions.filter((s) => s.status === 'active' || s.status === 'cancelled'); + const packOrders = orders + .map((o) => ({ order: o, tier: extractPackTier(o.service) })) + .filter((x): x is { order: Order; tier: PackTier } => x.tier !== null); + const tabs: { key: Tab; label: string; count?: number }[] = [ { key: 'projects', label: '프로젝트 현황', count: projects.length || undefined }, { key: 'orders', label: '의뢰 내역', count: orders.length || undefined }, { key: 'payments', label: '결제 내역', count: payments.length || undefined }, + { key: 'packs', label: '구매한 팩', count: packOrders.length || undefined }, { key: 'profile', label: '내 정보' }, { key: 'subscription', label: '구독 관리', count: activeSubs.length || undefined }, { key: 'saju', label: '사주 기록', count: sajuRecords.length || undefined }, @@ -299,34 +299,35 @@ export default function MyPage() { setShowTelegramGuide(false)} /> )} - {/* 헤더 */} -
+ {/* 헤더 — kx-surface 다크 톤, 축소판. 로그아웃은 TopNav에서 담당 */} +
-
+
{user.email?.[0].toUpperCase()}
-
{user.email}
-
- 가입일: {new Date(user.created_at).toLocaleDateString('ko-KR')} +
{user.email}
+
+ 가입일 {new Date(user.created_at).toLocaleDateString('ko-KR')}
-
- -
{/* 탭 */} -
+
{tabs.map((t) => (
@@ -748,6 +763,82 @@ export default function MyPage() {
)} + {/* 구매한 팩 */} + {tab === 'packs' && ( +
+ {packOrders.length === 0 ? ( + + ) : ( + packOrders.map(({ order, tier }) => { + const asset = PACK_ASSETS[tier]; + const statusLabel = + order.status === 'completed' ? '자료 발송 완료' : + order.status === 'in_progress' ? '결제 처리 중' : + '입금 대기'; + const statusColor = + order.status === 'completed' ? 'bg-violet-50 text-violet-600 border-violet-200' : + order.status === 'in_progress' ? 'bg-amber-50 text-amber-600 border-amber-200' : + 'bg-slate-100 text-slate-500 border-slate-200'; + + return ( +
+
+
+
{asset.name}
+
+ {new Date(order.created_at).toLocaleDateString('ko-KR')} 신청 +
+
+ + {statusLabel} + +
+ +
+
+ 📦 자료 패키지 ({asset.files.length}개) +
+
    + {asset.files.map((file, i) => ( +
  • + · + {file} +
  • + ))} +
+ + +

+ 현재는 카톡 1:1로 자료를 보내드립니다. 자동 다운로드는 곧 활성화됩니다. +
+ + 카톡 오픈채팅 → + +

+
+
+ ); + }) + )} +
+ )} + {/* 프로젝트 진행 현황 */} {tab === 'projects' && (