Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#118] 비회원 예매 조회에 navigation 연결 #119

Merged
merged 1 commit into from
Jul 14, 2024
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
19 changes: 19 additions & 0 deletions src/pages/nonMbLookup/NonMbLookup.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import * as S from "./NonMbLookup.styled";

import useModal from "@hooks/useModal";

import Button from "@components/commons/button/Button";
import InputWrapper from "./components/InputWrapper";

import { NAVIGATION_STATE } from "@constants/navigationState";
import { useHeader } from "@hooks/useHeader";

const NonMbLookup = () => {
const navigate = useNavigate();

const { openAlert } = useModal();
const { setHeader } = useHeader();

// 하단 내역 확인 버튼 활성화/비활성화 상태
const [btnActive, setBtnActive] = useState(false);
Expand Down Expand Up @@ -42,6 +49,10 @@ const NonMbLookup = () => {
});
};

const handleLeftBtn = () => {
navigate("/main");
};

useEffect(() => {
if (dataState === 404) {
handleAlert();
Expand All @@ -51,6 +62,14 @@ const NonMbLookup = () => {
}
}, [dataState]);

useEffect(() => {
setHeader({
headerStyle: NAVIGATION_STATE.ICON_TITLE,
title: "비회원 예매 조회",
leftOnClick: handleLeftBtn,
});
}, [setHeader]);

return (
<S.NonMbLookupWrapper>
<InputWrapper
Expand Down
5 changes: 1 addition & 4 deletions src/routes/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const router = createBrowserRouter([
element: <Layout />,
children: [
{ path: "a", element: <Apage /> },
{ path: "/NonMb-Lookup", element: <NonMbLookup /> },
{ path: "lookup", element: <Lookup /> },
{ path: "testpage", element: <TestPage /> },
{ path: "register", element: <Register /> },
Expand Down Expand Up @@ -50,10 +51,6 @@ const router = createBrowserRouter([
path: "/view-bottom-sheet",
element: <ViewBottomSheetTest />,
},
{
path: "/NonMb-Lookup",
element: <NonMbLookup />,
},
{
path: "/bank-sheet",
element: <BankTest />,
Expand Down
Loading