diff --git a/app/entities/common/Loading/LoadingIndicator.tsx b/app/entities/common/Loading/LoadingIndicator.tsx
index 07cb7cda..3d0390fa 100644
--- a/app/entities/common/Loading/LoadingIndicator.tsx
+++ b/app/entities/common/Loading/LoadingIndicator.tsx
@@ -2,11 +2,12 @@
import dynamic from 'next/dynamic';
import animation from '@/app/public/assets/loadingAnimation1.json';
+const Lottie = dynamic(() => import('react-lottie-player'), { ssr: false });
+
interface LoadingIndicatorProps {
message?: string;
}
const LoadingIndicator = ({ message }: LoadingIndicatorProps) => {
- const Lottie = dynamic(() => import('react-lottie-player'), { ssr: false });
return (
diff --git a/app/entities/common/NavBar.tsx b/app/entities/common/NavBar.tsx
index f6349ac7..fac63314 100644
--- a/app/entities/common/NavBar.tsx
+++ b/app/entities/common/NavBar.tsx
@@ -13,11 +13,12 @@ const TRANSPARENT_PATHS = ['/atelier'];
const NavBar = () => {
const [isFixed, setIsFixed] = useState(false);
- const [isSidebarOpen, setIsSidebarOpen] = useState(false);
+ const [sidebarOpenedAt, setSidebarOpenedAt] = useState(null);
const { theme, toggleTheme } = useTheme();
const pathname = usePathname();
const isTransparent = TRANSPARENT_PATHS.some((p) => pathname.startsWith(p));
+ const isSidebarOpen = sidebarOpenedAt === pathname;
useEffect(() => {
const handleScroll = () => {
@@ -28,10 +29,6 @@ const NavBar = () => {
return () => window.removeEventListener('scroll', handleScroll);
}, []);
- useEffect(() => {
- setIsSidebarOpen(false);
- }, [pathname]);
-
useEffect(() => {
document.body.style.overflow = isSidebarOpen ? 'hidden' : '';
return () => {
@@ -39,8 +36,8 @@ const NavBar = () => {
};
}, [isSidebarOpen]);
- const handleSidebarOpen = () => setIsSidebarOpen(true);
- const handleSidebarClose = () => setIsSidebarOpen(false);
+ const handleSidebarOpen = () => setSidebarOpenedAt(pathname);
+ const handleSidebarClose = () => setSidebarOpenedAt(null);
const fixedStyle = isTransparent
? 'bg-transparent'
diff --git a/app/entities/common/Overlay/Image/ImageZoomViewer.tsx b/app/entities/common/Overlay/Image/ImageZoomViewer.tsx
index cadfa227..e8718cb2 100644
--- a/app/entities/common/Overlay/Image/ImageZoomViewer.tsx
+++ b/app/entities/common/Overlay/Image/ImageZoomViewer.tsx
@@ -22,6 +22,15 @@ const ImageZoomViewer = ({ image, onClose }: ImageZoomViewerProps) => {
const [visible, setVisible] = useState(false);
const [zoom, setZoom] = useState(1);
const [offset, setOffset] = useState({ x: 0, y: 0 });
+ const [prevSrc, setPrevSrc] = useState(null);
+
+ const currentSrc = image?.src ?? null;
+ if (prevSrc !== currentSrc && currentSrc !== null) {
+ setPrevSrc(currentSrc);
+ setZoom(1);
+ setOffset({ x: 0, y: 0 });
+ setVisible(true);
+ }
const containerRef = useRef(null);
const dimsRef = useRef<{ startX: number; startY: number; startScale: number } | null>(null);
@@ -54,10 +63,6 @@ const ImageZoomViewer = ({ image, onClose }: ImageZoomViewerProps) => {
dimsRef.current = { startX, startY, startScale };
- setZoom(1);
- setOffset({ x: 0, y: 0 });
- setVisible(true);
-
// 원본 위치에 즉시 배치 후 중앙으로 spring 애니메이션
x.set(startX);
y.set(startY);
diff --git a/app/entities/common/Profile.tsx b/app/entities/common/Profile.tsx
index d1aa0556..5406cb73 100644
--- a/app/entities/common/Profile.tsx
+++ b/app/entities/common/Profile.tsx
@@ -1,6 +1,5 @@
import { StaticImport } from 'next/dist/shared/lib/get-img-props';
import Image from 'next/image';
-import React from 'react';
interface Props {
profileThumbnail?: string | StaticImport;
diff --git a/app/entities/common/Toast/Toast.tsx b/app/entities/common/Toast/Toast.tsx
index 5487755b..6b9f72a8 100644
--- a/app/entities/common/Toast/Toast.tsx
+++ b/app/entities/common/Toast/Toast.tsx
@@ -1,3 +1,4 @@
+import React from 'react';
import { CiCircleCheck, CiCircleRemove, CiMail } from 'react-icons/ci';
type ToastType = 'success' | 'error' | 'info';
@@ -9,7 +10,7 @@ interface ToastProps {
removeToast: () => void;
}
-const iconMap: Record = {
+const iconMap: Record = {
success: ,
error: ,
info: ,
diff --git a/app/entities/portfolio/Carousel.tsx b/app/entities/portfolio/Carousel.tsx
index 238f927b..2b605063 100644
--- a/app/entities/portfolio/Carousel.tsx
+++ b/app/entities/portfolio/Carousel.tsx
@@ -173,10 +173,7 @@ const Carousel = ({ slides }: CarouselProps) => {
? currentSlides.length - 1
: currentIndex - 1
] as ReactElement,
- {
- hideTags: true,
-
- }
+ { hideTags: true } as Record
)}
)}
@@ -195,10 +192,7 @@ const Carousel = ({ slides }: CarouselProps) => {
? 0
: currentIndex + 1
] as ReactElement,
- {
- hideTags: true,
-
- }
+ { hideTags: true } as Record
)}
)}
diff --git a/app/entities/portfolio/PortfolioStone.tsx b/app/entities/portfolio/PortfolioStone.tsx
index 2b4e7175..51a08142 100644
--- a/app/entities/portfolio/PortfolioStone.tsx
+++ b/app/entities/portfolio/PortfolioStone.tsx
@@ -27,15 +27,15 @@ const PortfolioStone = ({
const portfolioDetailUrl = project.slug ? `/portfolio/${project.slug}` : null;
return (
-