Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 9 additions & 54 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { NextConfig } from 'next';
import withPWA from 'next-pwa';

const nextConfig: NextConfig = {
images: {
Expand Down Expand Up @@ -36,59 +37,13 @@ const nextConfig: NextConfig = {
},
},
},
// PWA configuration
pwa: {
dest: 'public',
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development',
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts',
expiration: {
maxEntries: 4,
maxAgeSeconds: 365 * 24 * 60 * 60,
},
},
},
{
urlPattern: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'static-font-assets',
expiration: {
maxEntries: 4,
maxAgeSeconds: 7 * 24 * 60 * 60,
},
},
},
{
urlPattern: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'static-image-assets',
expiration: {
maxEntries: 64,
maxAgeSeconds: 24 * 60 * 60,
},
},
},
{
urlPattern: /\/_next\/static.+\.js$/i,
handler: 'CacheFirst',
options: {
cacheName: 'next-static-js-assets',
expiration: {
maxEntries: 64,
maxAgeSeconds: 24 * 60 * 60,
},
},
},
],
},
};
const pwaConfig = withPWA({
dest: 'public',
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development',
// @ts-ignore
})(nextConfig);

export default nextConfig;
export default pwaConfig;
1 change: 1 addition & 0 deletions public/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/workbox-4754cb34.js

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions src/app/(pages)/(auth)/auth/login/kakao/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { LoadingSpinner } from '@/components/loading-spinner';
import { api } from '@/lib/api';
import { redirect, useRouter, useSearchParams } from 'next/navigation';
import { useEffect, useState } from 'react';
import { useEffect, useState, Suspense } from 'react';

export default function LoginKakaoPage() {
function LoginKakaoContent() {
const searchParams = useSearchParams();
const code = searchParams.get('code');
const [isLoading, setIsLoading] = useState(false);
Expand Down Expand Up @@ -52,3 +52,11 @@ export default function LoginKakaoPage() {

return <LoadingSpinner />;
}

export default function LoginKakaoPage() {
return (
<Suspense fallback={<LoadingSpinner />}>
<LoginKakaoContent />
</Suspense>
);
}
2 changes: 1 addition & 1 deletion src/app/(pages)/contest/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function ContestDetailPage({ params }: ContestDetailPageProps) {
}
};

fetchContestDetail();
void fetchContestDetail();
}, [resolvedParams.id]);

if (loading) {
Expand Down
20 changes: 14 additions & 6 deletions src/app/(pages)/home/_components/course-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { useRecommendedCourses } from '../../_hooks/use-recommended-courses';
import { getUserDataCached } from '@/lib/api/home';

export function CourseSection() {
const [activeTab, setActiveTab] = useState<'nationwide' | 'destinations'>('nationwide');
const [activeTab, setActiveTab] = useState<'nationwide' | 'destinations'>(
'nationwide',
);

// 사용자 정보 조회
const { data: userDataResponse } = useQuery({
Expand All @@ -20,7 +22,7 @@ export function CourseSection() {
});

// 목적지 정보 추출
const destination = userDataResponse?.data?.destination || '';
const destination = userDataResponse?.data?.destination ?? '';
const hasDestination = destination.trim() !== '';

// API 호출 조건 결정
Expand All @@ -36,8 +38,8 @@ export function CourseSection() {
useRecommendedCourses(true, regionParam);

// 데이터 추출
const popularCourses = popularCoursesResponse?.data || [];
const recommendedCourses = recommendedCoursesResponse?.data || [];
const popularCourses = popularCoursesResponse?.data ?? [];
const recommendedCourses = recommendedCoursesResponse?.data ?? [];

// 이벤트 핸들러
const handleTabChange = (tab: 'nationwide' | 'destinations') => {
Expand All @@ -59,11 +61,17 @@ export function CourseSection() {
) : shouldShowCourses ? (
<>
<div className='mt-8 pl-5'>
<PopularCourse courses={popularCourses} isLoading={popularLoading} />
<PopularCourse
courses={popularCourses}
isLoading={popularLoading}
/>
</div>

<div className='mt-8 pl-5'>
<AICourse courses={recommendedCourses} isLoading={recommendedLoading} />
<AICourse
courses={recommendedCourses}
isLoading={recommendedLoading}
/>
</div>
</>
) : null}
Expand Down
6 changes: 2 additions & 4 deletions src/app/(pages)/home/_components/header/intro-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { getUserDataCached } from '@/lib/api/home';

export async function IntroText() {
const userResponse = await getUserDataCached();
const userName = userResponse?.data?.nickname || '유저';
const userName = userResponse?.data?.nickname ?? '유저';

return (
<section>
<p className='text-white000 text-[16px]'>
반가워요, {userName}님
</p>
<p className='text-white000 text-[16px]'>반가워요, {userName}님</p>
<p className='text-white000 text-[24px] font-semibold whitespace-nowrap'>
오늘도 나만의 여행길을 달려볼까요?
</p>
Expand Down
11 changes: 7 additions & 4 deletions src/app/(pages)/home/_components/header/profile-image.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getUserDataCached } from '@/lib/api/home';
import { UserIcon } from 'lucide-react';
import Image from 'next/image';
import Link from 'next/link';

Expand All @@ -7,8 +8,8 @@ export async function ProfileImage() {
const profileImageUrl = userResponse?.data?.profileImageUrl;

return (
<Link href="/mypage" className='block'>
<div className='h-11 w-11 rounded-full overflow-hidden bg-gray-200 cursor-pointer hover:opacity-80 transition-opacity'>
<Link href='/mypage' className='block'>
<div className='h-11 w-11 cursor-pointer overflow-hidden rounded-full bg-gray-200 transition-opacity hover:opacity-80'>
{profileImageUrl ? (
<Image
src={profileImageUrl}
Expand All @@ -18,9 +19,11 @@ export async function ProfileImage() {
className='h-full w-full object-cover'
/>
) : (
<div className='bg-black000 h-full w-full' />
<div className='h-full w-full bg-gray-200 p-2'>
<UserIcon className='text-gray-4 h-full w-full' />
</div>
)}
</div>
</Link>
);
}
}
Loading
Loading