From 69414d2f58c1e97dc35ebbb28f9c654d96dafc25 Mon Sep 17 00:00:00 2001 From: Hyeonjun0527 Date: Sun, 1 Feb 2026 21:03:05 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B0=81=EC=A2=85=20=EB=B2=84=EA=B7=B8?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit . --- next.config.ts | 14 ++- src/app/(service)/home/home-content.tsx | 10 +- src/components/card/voting-card.tsx | 2 +- src/components/home/tab-navigation.tsx | 10 +- .../study-history/study-history-row.tsx | 14 +-- src/components/ui/avatar/index.tsx | 2 + src/components/ui/profile-avatar.tsx | 102 ------------------ src/components/voting/voting-detail-view.tsx | 60 ++++++++--- .../user/ui/user-phone-number-copy-modal.tsx | 34 ++++-- .../study/interview/api/interview-types.ts | 2 + .../archive/model/use-archive-actions.ts | 12 ++- .../one-to-one/archive/ui/archive-filters.tsx | 4 + .../archive/ui/archive-tab-client.tsx | 6 +- .../ui/hall-of-fame-tab-client.tsx | 20 ++-- .../schedule/ui/today-study-card.tsx | 10 +- .../study/one-to-one/ui/one-on-one-page.tsx | 14 +-- src/types/hall-of-fame.ts | 6 +- 17 files changed, 161 insertions(+), 161 deletions(-) delete mode 100644 src/components/ui/profile-avatar.tsx diff --git a/next.config.ts b/next.config.ts index fa0942f5..51ef58b3 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,4 +1,7 @@ import type { NextConfig } from 'next'; +import type { RemotePattern } from 'next/dist/shared/lib/image-config'; + +const isProd = process.env.NODE_ENV === 'production'; const nextConfig: NextConfig = { // output: 'standalone', @@ -31,7 +34,16 @@ const nextConfig: NextConfig = { hostname: 'www.zeroone.it.kr', pathname: '/**', }, - // CMS 개발 환경에서 사용하는 이미지 도메인 허용 설정 + ...(isProd + ? ([] as RemotePattern[]) + : ([ + { + protocol: 'http', + hostname: 'localhost', + port: '8080', + pathname: '/**', + }, + ] as RemotePattern[])), { protocol: 'http', hostname: 'localhost', diff --git a/src/app/(service)/home/home-content.tsx b/src/app/(service)/home/home-content.tsx index b20f2849..47f639eb 100644 --- a/src/app/(service)/home/home-content.tsx +++ b/src/app/(service)/home/home-content.tsx @@ -5,18 +5,24 @@ import CommunityTab from '@/features/study/one-to-one/balance-game/ui/community- import HallOfFameTab from '@/features/study/one-to-one/hall-of-fame/ui/hall-of-fame-tab'; import StudyHistoryTab from '@/features/study/one-to-one/history/ui/study-history-tab'; import StudyTab from '@/features/study/one-to-one/schedule/ui/home-study-tab'; +import { getServerCookie } from '@/utils/server-cookie'; +import { isNumeric } from '@/utils/validation'; interface HomeContentProps { activeTab: string; } -export default function HomeContent({ activeTab }: HomeContentProps) { +export default async function HomeContent({ activeTab }: HomeContentProps) { + const isHistoryTab = activeTab === 'history'; + const memberIdStr = isHistoryTab ? await getServerCookie('memberId') : null; + const isLoggedIn = !!memberIdStr && isNumeric(memberIdStr); + const renderTabContent = () => { switch (activeTab) { case 'study': return ; case 'history': - return ; + return isLoggedIn ? : ; case 'ranking': return ; case 'archive': diff --git a/src/components/card/voting-card.tsx b/src/components/card/voting-card.tsx index 81b2b836..365e2eb1 100644 --- a/src/components/card/voting-card.tsx +++ b/src/components/card/voting-card.tsx @@ -90,7 +90,7 @@ export default function VotingCard({ voting, onClick }: VotingCardProps) {

)} - {/* 간단한 투표 결과 미리보기 (투표했을 때만) */} + {/* 간단한 투표 결과 미리보기 */} {hasVoted && (
diff --git a/src/components/home/tab-navigation.tsx b/src/components/home/tab-navigation.tsx index 13a09619..5f791d13 100644 --- a/src/components/home/tab-navigation.tsx +++ b/src/components/home/tab-navigation.tsx @@ -8,7 +8,9 @@ import { History, } from 'lucide-react'; import { useRouter, useSearchParams } from 'next/navigation'; +import { getCookie } from '@/api/client/cookie'; import { cn } from '@/components/ui/(shadcn)/lib/utils'; +import { useAuth } from '@/hooks/common/use-auth'; interface TabNavigationProps { activeTab: string; @@ -50,6 +52,12 @@ const TABS = [ export default function TabNavigation({ activeTab }: TabNavigationProps) { const router = useRouter(); const searchParams = useSearchParams(); + const { isAuthenticated } = useAuth(); + const hasMemberId = !!getCookie('memberId'); + const canViewHistory = isAuthenticated && hasMemberId; + const visibleTabs = canViewHistory + ? TABS + : TABS.filter((tab) => tab.id !== 'history'); const handleTabChange = (tabId: string) => { const params = new URLSearchParams(searchParams.toString()); @@ -64,7 +72,7 @@ export default function TabNavigation({ activeTab }: TabNavigationProps) {