Skip to content

Commit

Permalink
Merge pull request #16 from pythonkr/feature/add-sprint-page
Browse files Browse the repository at this point in the history
티켓 판매 일정 추가 및 로그인 한 유저만 구매 페이지에 진입할 수 있도록 수정
  • Loading branch information
golony6449 authored Jun 9, 2024
2 parents 15c4fa8 + 709653e commit 60b66b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/Ticket/buy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const BuyTicket = ({ onPaymentCompleted }: Props) => {
{Object.entries(tickets).map(([k, v]) => (
<div key={k}>
<h2>{t(v.name)}</h2>
<h3>티켓 판매 시작: 2024년 7월 15일 14:00 부터</h3>
<table>
<tbody>
{v.tickets.map((ticket) => (
Expand Down
9 changes: 9 additions & 0 deletions src/pages/Ticket/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import React, { useState } from "react";
import BuyTicket from "./buy";
import PaymentResult from "./paymentResult";
import { useNavigate } from "react-router";
import { Navigate } from "react-router-dom";

type State = {
view: "LIST" | "PAYMENT_RESULT";
};

const TicketPage = () => {
const [view, setView] = useState<State["view"]>("LIST");
const navigate = useNavigate();

switch (view) {
case "LIST":

if (!localStorage.getItem("id")) {
alert("로그인이 필요합니다.");
return <Navigate to={"/login"}/>;
}

return (
<BuyTicket
onPaymentCompleted={() => {
Expand Down

0 comments on commit 60b66b4

Please sign in to comment.