Skip to content

Commit fc2319f

Browse files
authored
Merge pull request #75 from 3rdflr/feat/TRI-79
fix TRI-79: 버셀에서 이미지 최적화 사용량 초과로 이미지 생성에 오류가 생기던 문제 해결
2 parents e18760e + 42b0eff commit fc2319f

File tree

14 files changed

+89
-14
lines changed

14 files changed

+89
-14
lines changed

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const nextConfig = {
22
images: {
3+
unoptimized: true,
34
remotePatterns: [
45
{
56
protocol: 'https',

src/app/layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const metadata: Metadata = {
5757
'max-snippet': -1,
5858
},
5959
},
60-
themeColor: '#e60e68',
6160
};
6261

6362
export default function RootLayout({

src/components/common/Footer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import Image from 'next/image';
44
import Link from 'next/link';
55
import { useSearchParams } from 'next/navigation';
6+
import { wsrvLoader } from '../common/wsrvLoader';
67

78
export default function Footer() {
89
const searchParams = useSearchParams();
@@ -15,6 +16,8 @@ export default function Footer() {
1516
<div className='bg-white w-full h-20 rounded-b-full shadow-lg mb-30'></div>
1617

1718
<Image
19+
loader={wsrvLoader}
20+
loading='lazy'
1821
src={'/images/icons/logo.svg'}
1922
alt='트리베라 로고'
2023
width={0}

src/components/common/Nav.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useState, useEffect } from 'react';
44
import { usePathname } from 'next/navigation';
55
import { motion, useScroll, useTransform, useSpring } from 'framer-motion';
66
import { useScreenSize } from '@/hooks/useScreenSize';
7+
import { wsrvLoader } from '../common/wsrvLoader';
78
import Link from 'next/link';
89
import Image from 'next/image';
910
import CategoryList from '../home/CategoryList';
@@ -64,14 +65,23 @@ export default function Nav() {
6465
<Link href='/' className={`${isSearching ? 'z-[100]' : 'z-[120]'}`}>
6566
{isTablet ? (
6667
<Image
68+
loader={wsrvLoader}
69+
loading='lazy'
6770
src='/images/icons/small_logo.svg'
6871
alt='Logo'
6972
width={40}
7073
height={40}
7174
className='w-[40px] h-[40px]'
7275
/>
7376
) : (
74-
<Image src='/images/icons/logo.svg' alt='Logo' width={105} height={26} />
77+
<Image
78+
loader={wsrvLoader}
79+
loading='lazy'
80+
src='/images/icons/logo.svg'
81+
alt='Logo'
82+
width={105}
83+
height={26}
84+
/>
7585
)}
7686
</Link>
7787

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const wsrvLoader = ({
2+
src,
3+
width,
4+
quality,
5+
}: {
6+
src: string;
7+
width: number;
8+
quality?: number;
9+
}) => {
10+
return `https://wsrv.nl/?url=${encodeURIComponent(src)}&w=${width}&q=${quality || 75}`;
11+
};

src/components/home/ActivityCard.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { BASE_IMG_URL } from '@/components/home/Constants';
77
import { Activity } from '@/types/activities.type';
88
import { useRecentViewedStore } from '@/store/recentlyWatched';
99
import { successToast } from '@/lib/utils/toastUtils';
10+
import { wsrvLoader } from '../common/wsrvLoader';
1011
import { X } from 'lucide-react';
1112
import Image from 'next/image';
1213
import ActivityLike from './ActivityLike';
@@ -36,6 +37,8 @@ export default function ActivityCard({
3637
{/* 배너 이미지 (에러 시 기본 이미지 fallback) */}
3738
<div className='relative w-full aspect-square rounded-[20px] overflow-hidden bg-grayscale-25'>
3839
<Image
40+
loader={wsrvLoader}
41+
loading='lazy'
3942
src={bannerImg}
4043
alt={activity.title}
4144
fill

src/components/home/ActivityList.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useUserStore } from '@/store/userStore';
66
import { useElementInView } from '@/hooks/useElemetInView';
77
import { useInfiniteList } from '@/hooks/useInfiniteList';
88
import { ChevronRight, MapPinCheckInside } from 'lucide-react';
9+
import { wsrvLoader } from '../common/wsrvLoader';
910
import Spinner from '../common/Spinner';
1011
import ActivityCard from './ActivityCard';
1112
import Image from 'next/image';
@@ -44,17 +45,21 @@ export default function ActivityList({
4445
<div className='flex flex-col items-center justify-center gap-7 mt-50'>
4546
<div className='flex flex-col items-center justify-center'>
4647
<Image
48+
loader={wsrvLoader}
4749
src={'/images/icons/Logo_top.svg'}
4850
alt='빈 체험 로고'
4951
width={234}
5052
height={337}
53+
loading='lazy'
5154
className='animate-bounce w-[234px] h-auto'
5255
/>
5356
<Image
57+
loader={wsrvLoader}
5458
src={'/images/icons/Logo_bottom.svg'}
5559
alt='빈 체험 로고'
5660
width={45}
5761
height={16}
62+
loading='lazy'
5863
className='w-[45px] h-auto'
5964
/>
6065
</div>

src/components/home/BottomNav.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Bell, Search, Heart } from 'lucide-react';
88
import { useUserStore } from '@/store/userStore';
99
import { useScreenSize } from '@/hooks/useScreenSize';
1010
import { useNotifications } from '@/hooks/useNotification';
11+
import { wsrvLoader } from '../common/wsrvLoader';
1112
import Link from 'next/link';
1213
import Image from 'next/image';
1314
import NotificationModal from './NotificationModal';
@@ -118,6 +119,8 @@ export default function BottomNav() {
118119
href='/mypage'
119120
>
120121
<Image
122+
loader={wsrvLoader}
123+
loading='lazy'
121124
src={
122125
user.profileImageUrl ? user.profileImageUrl : '/images/icons/default_profile.svg'
123126
}
@@ -148,6 +151,8 @@ export default function BottomNav() {
148151
href='/login'
149152
>
150153
<Image
154+
loader={wsrvLoader}
155+
loading='lazy'
151156
src={'/images/icons/default_profile_gray.svg'}
152157
alt='Profile'
153158
width={20}

src/components/home/LoginSection.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import { useUserStore } from '@/store/userStore';
88
import { logout } from '@/lib/utils/logoutUtils';
99
import { Bell, Heart, CircleUser, LogOut } from 'lucide-react';
1010
import { useNotifications } from '@/hooks/useNotification';
11+
import { useSaveCurrentUrl } from '@/lib/utils/useSaveCurrentUrl';
12+
import { wsrvLoader } from '../common/wsrvLoader';
1113
import Link from 'next/link';
1214
import Image from 'next/image';
1315
import NotificationModal from './NotificationModal';
14-
import { useSaveCurrentUrl } from '@/lib/utils/useSaveCurrentUrl';
1516

1617
export default function LoginSection() {
1718
const { isDesktop } = useScreenSize();
@@ -38,6 +39,8 @@ export default function LoginSection() {
3839
<Dropdown.Trigger>
3940
<div className='w-[30px] h-[30px] rounded-full cursor-pointer overflow-hidden'>
4041
<Image
42+
loader={wsrvLoader}
43+
loading='lazy'
4144
src={
4245
user.profileImageUrl ? user.profileImageUrl : '/images/icons/default_profile.svg'
4346
}
@@ -73,7 +76,14 @@ export default function LoginSection() {
7376
</Link>
7477
)}
7578
<Link onClick={saveCurrentUrl} href='/login' className='cursor-pointer'>
76-
<Image src='/images/icons/default_profile_gray.svg' alt='Profile' width={30} height={30} />
79+
<Image
80+
loader={wsrvLoader}
81+
loading='lazy'
82+
src='/images/icons/default_profile_gray.svg'
83+
alt='Profile'
84+
width={30}
85+
height={30}
86+
/>
7787
</Link>
7888
</>
7989
);

src/components/home/MapCard.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use client';
22

3-
import Link from 'next/link';
4-
import Image from 'next/image';
53
import { useState } from 'react';
64
import { Activity } from '@/types/activities.type';
75
import { useUserStore } from '@/store/userStore';
86
import { BASE_IMG_URL } from './Constants';
9-
import { X } from 'lucide-react';
10-
import ActivityLike from './ActivityLike';
117
import { useScreenSize } from '@/hooks/useScreenSize';
128
import { AnimatePresence, motion } from 'framer-motion';
9+
import { X } from 'lucide-react';
10+
import { wsrvLoader } from '../common/wsrvLoader';
11+
import Link from 'next/link';
12+
import Image from 'next/image';
13+
import ActivityLike from './ActivityLike';
1314

1415
interface MapCardProps {
1516
activity: Activity;
@@ -88,13 +89,14 @@ export default function MapCard({ activity, onClose }: MapCardProps) {
8889
<Link href={`/activities/${activity.id}`}>
8990
<div className='w-[126px] h-full relative flex-shrink-0'>
9091
<Image
92+
loader={wsrvLoader}
93+
loading='lazy'
9194
src={bannerImg}
9295
alt={activity.title}
9396
fill
9497
className='object-cover rounded-l-2xl'
9598
onError={() => setIsError(true)}
9699
blurDataURL={BASE_IMG_URL}
97-
loading='lazy'
98100
/>
99101
</div>
100102
</Link>

0 commit comments

Comments
 (0)