Skip to content

Commit c378ff4

Browse files
committed
버그들 수정
1 parent a2e5539 commit c378ff4

File tree

28 files changed

+290
-295
lines changed

28 files changed

+290
-295
lines changed

next.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
4+
experimental: {
5+
scrollRestoration: false,
6+
},
47
images: {
58
domains: ['team2-app-s3-bucket.s3.ap-northeast-2.amazonaws.com'],
69
remotePatterns: [
@@ -9,6 +12,7 @@ const nextConfig: NextConfig = {
912
hostname: 'www.thecocktaildb.com',
1013
},
1114
],
15+
qualities: [25, 50, 75, 90, 100],
1216
},
1317
env: {
1418
NPUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,

public/1star.webp

1.26 KB
Loading

public/2star.webp

1.94 KB
Loading

src/app/(no-layout)/layout.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1+
import FooterWrapper from '@/shared/components/footer/FooterWrapper';
2+
import Header from '@/shared/components/header/Header';
3+
14
function NoLayout({ children }: { children: React.ReactNode }) {
2-
return <main className="flex flex-1">{children}</main>;
5+
return (
6+
<>
7+
<Header className="bg-transparent w-full h-[44px] md:h-[60px] flex items-center justify-between px-[12px] fixed top-0 left-0 z-50 transition-transform duration-200 ease-in-ou" />
8+
<main className="flex flex-1">{children}</main>
9+
<FooterWrapper />
10+
</>
11+
);
312
}
413
export default NoLayout;

src/app/(no-layout)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import FinalLanding from '@/domains/main/components/FinalLanding';
22

33
export default function Home() {
44
return (
5-
<div className="page-layout max-w-full">
5+
<div className="max-w-full flex-1">
66
<FinalLanding />
77
</div>
88
);

src/app/(with-layout)/community/[id]/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export async function generateMetadata({
1414
cache: 'no-store',
1515
});
1616
const post = await res.json();
17-
console.log(post);
1817
return {
1918
title: post.title,
2019
description: post.content?.slice(0, 80),

src/app/(with-layout)/community/edit/[postId]/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { useParams } from 'next/navigation';
66

77
function Page() {
88
const params = useParams();
9-
console.log(params);
109

1110
return (
1211
<div className="w-full mb-20 flex relative">

src/domains/community/components/textarea/AutoGrowingTextarea.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { Virtualizer } from '@tanstack/react-virtual';
21
import gsap from 'gsap';
32
import { useEffect, useRef } from 'react';
43

54
type Props = {
65
value: string;
76
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
8-
rowVirtualize: Virtualizer<HTMLElement, Element>;
97
};
108

11-
function AutoGrowingTextarea({ value, onChange, rowVirtualize }: Props) {
9+
function AutoGrowingTextarea({ value, onChange }: Props) {
1210
const textareaRef = useRef<HTMLTextAreaElement | null>(null);
1311

1412
useEffect(() => {
@@ -29,17 +27,6 @@ function AutoGrowingTextarea({ value, onChange, rowVirtualize }: Props) {
2927
};
3028
}, []);
3129

32-
useEffect(() => {
33-
if (textareaRef.current) {
34-
requestAnimationFrame(() => {
35-
const li = textareaRef.current?.closest('li') as HTMLElement | null;
36-
if (li) {
37-
rowVirtualize.measureElement(li);
38-
}
39-
});
40-
}
41-
}, [value]);
42-
4330
useEffect(() => {
4431
if (!textareaRef.current) return;
4532
gsap.fromTo(

src/domains/community/detail/DetailPage.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ function DetailPage() {
2727
const [like, setLike] = useState<boolean | null>(null);
2828
const [prevLikeCount, setPrevLikeCount] = useState<number | undefined>(0);
2929

30-
useEffect(() => {
31-
console.log('like:', like);
32-
console.log('prevLikeCount:', prevLikeCount);
33-
}, [like, prevLikeCount]);
34-
3530
const isLoggedIn = useAuthStore((state) => state.isLoggedIn);
3631
const router = useRouter();
3732

src/domains/community/detail/ImageSlide.tsx

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
11
import Image from 'next/image';
22
import { Swiper, SwiperSlide } from 'swiper/react';
33
import { Navigation, Pagination } from 'swiper/modules';
4+
import { useState } from 'react';
45

56
function ImageSlide({ imageUrls }: { imageUrls: string[] }) {
7+
const shouldLoop = imageUrls.length > 1;
8+
const [loadedImages, setLoadedImages] = useState<Set<string>>(new Set());
9+
10+
const handleImageLoad = (imgUrl: string) => {
11+
setLoadedImages((prev) => new Set(prev).add(imgUrl));
12+
};
13+
614
return (
715
<Swiper
816
spaceBetween={20}
917
modules={[Navigation, Pagination]}
10-
navigation
18+
navigation={shouldLoop}
1119
pagination={{ clickable: true, type: 'bullets' }}
12-
loop
20+
loop={shouldLoop}
1321
className="w-full max-h-100 flex justify-center items-center"
1422
>
1523
{imageUrls.length > 0 &&
1624
imageUrls.map((img) => (
1725
<SwiperSlide className="w-full flex justify-center items-center" key={img}>
18-
<Image
19-
src={img}
20-
alt="이미지"
21-
width={150}
22-
height={150}
23-
className="object-contain w-full max-h-[400px]"
24-
/>
26+
<div className="relative w-full h-[400px] flex items-center justify-center">
27+
{!loadedImages.has(img) && (
28+
<div className="absolute inset-0 flex items-center justify-center bg-gray/80 rounded-lg">
29+
<div className="w-8 h-8 border-4 border-secondary border-t-tertiary rounded-full animate-spin"></div>
30+
</div>
31+
)}
32+
<Image
33+
src={img}
34+
alt="이미지"
35+
width={800}
36+
height={600}
37+
quality={90}
38+
priority
39+
onLoad={() => handleImageLoad(img)}
40+
onError={() => handleImageLoad(img)}
41+
className={`object-contain w-full max-h-[400px] transition-opacity duration-300 ${
42+
loadedImages.has(img) ? 'opacity-100' : 'opacity-0'
43+
}`}
44+
style={{ width: 'auto', height: 'auto' }}
45+
/>
46+
</div>
2547
</SwiperSlide>
2648
))}
2749
</Swiper>

0 commit comments

Comments
 (0)