Skip to content

Commit 20a1837

Browse files
authored
Merge pull request #501 from GTable/develop
feat: 페이지 전환 애니메이션 임시 제거
2 parents 53bb1e8 + 6504971 commit 20a1837

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

apps/nowait-user/src/components/layout/PageTransitionWrapper.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef } from "react";
1+
import React, { useRef } from "react";
22
import "./transition.css";
33
import { TransitionGroup, CSSTransition } from "react-transition-group";
44
import { useNavigationType } from "react-router-dom";
@@ -21,13 +21,14 @@ const PageTransitionWrapper = ({ location, children }: PropsType) => {
2121
const pathname = location.pathname;
2222
const isBack = location.state?.isBack as boolean | undefined;
2323
console.log(isBack, "이즈백");
24+
2425
//라우터 이동 방향에 따른 애니메이션 분리
2526
const isNavigatePush = navigateType === "PUSH" && !isBack;
26-
const isNavigatePop = navigateType === "POP" || isBack;
27-
const isNavigateReplace = navigateType === "REPLACE";
27+
const isNavigateReplace = navigateType === "REPLACE" && !isBack;
28+
2829
const isAnimation = () => {
2930
if (isNavigatePush) return "navigate-push";
30-
if (isNavigatePop) return "navigate-pop";
31+
if (isBack) return "navigate-pop";
3132
if (isNavigateReplace) return "";
3233
return "";
3334
};
@@ -41,11 +42,6 @@ const PageTransitionWrapper = ({ location, children }: PropsType) => {
4142

4243
const currentNodeRef = nodeRefs.current[pathname];
4344

44-
useEffect(() => {
45-
if (isNavigatePush || isNavigatePop) {
46-
window.scrollTo(0, 0);
47-
}
48-
}, [pathname, isNavigatePush, isNavigatePop]);
4945
return (
5046
<TransitionGroup
5147
className={"transition-wrapper"}

apps/nowait-user/src/routes/Router.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import OrderSuccessPage from "../pages/order/orderSuccess/OrderSuccessPage";
1010
import LoginPage from "../pages/login/LoginPage";
1111
import KakaoRedirectHandler from "../pages/login/KakaoRedirectHandler";
1212
import AuthGuard from "../components/AuthGuard";
13-
import PageTransitionWrapper from "../components/layout/PageTransitionWrapper";
1413
import WaitingPartySizeForm from "../pages/waiting/waitingPartysize/WaitingPartySizeForm";
1514
import AddMenuPage from "../pages/order/addMenu/AddMenuPage";
1615
import RemittanceWaitPage from "../pages/order/remittenceWait/RemittanceWaitPage";
@@ -34,7 +33,6 @@ const withAuth = (Component: React.ComponentType) => (
3433
const Router = () => {
3534
const location = useLocation();
3635
return (
37-
<PageTransitionWrapper location={location}>
3836
<Routes location={location}>
3937
{/* 공개 라우트 - 인증 불필요 */}
4038
<Route path="/login/success" element={<KakaoRedirectHandler />} />
@@ -84,7 +82,6 @@ const Router = () => {
8482
<Route path="/:storeId/orderDetails" element={<OrderDetailsPage />} />
8583
<Route path="*" element={<NotFound />} />
8684
</Routes>
87-
</PageTransitionWrapper>
8885
);
8986
};
9087

0 commit comments

Comments
 (0)