From 90e39acf602a5237a917d75a5a1ce6ade8962351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=84=EB=8F=99=EC=9E=AC?= Date: Mon, 17 Feb 2025 00:21:05 +0900 Subject: [PATCH] =?UTF-8?q?#49=20refactor:=20=ED=8C=80=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EB=AA=A8=EB=8B=AC=20=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - string 재변경 --- baseballDiary/src/pages/DiaryNew.tsx | 36 +++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/baseballDiary/src/pages/DiaryNew.tsx b/baseballDiary/src/pages/DiaryNew.tsx index b892bf3..b4201c1 100644 --- a/baseballDiary/src/pages/DiaryNew.tsx +++ b/baseballDiary/src/pages/DiaryNew.tsx @@ -1,4 +1,5 @@ import { useState } from "react"; +import { useNavigate } from "react-router-dom"; import lotte from "../assets/team/lotte.png"; import doosan from "../assets/team/doosan.png"; import samsung from "../assets/team/samsung.png"; @@ -23,21 +24,23 @@ import NextButton from "../components/Next-button"; const teamAssets = { lotte, doosan, samsung, kiwoom, hanhwa, kia, kt, nc, lg, ssg, kbo }; // 한글 팀 이름 매핑 (kbo 제외) const teamNames: { [key: string]: string } = { - lotte: "롯데", - doosan: "두산", - samsung: "삼성", - kiwoom: "키움", - hanhwa: "한화", - kia: "기아", - kt: "KT", - nc: "NC", - lg: "LG", - ssg: "SSG", + lotte: "롯데 자이언츠", + doosan: "두산 베어스", + samsung: "삼성 라이온즈", + kiwoom: "키움 히어로즈", + hanhwa: "한화 이글즈", + kia: "KIA 타이거즈", + kt: "Kt wiz", + nc: "NC 다이노스", + lg: "LG 트윈스", + ssg: "SSG 랜더스", }; +// 내 팀(dummyMyTeam)과 매핑 (검색 view의 왼쪽에 내 팀을 표시할 때 사용) const teamMapping: { [key: string]: string } = { "한화": "hanhwa", "롯데": "lotte", }; + const feelingAssets = [feeling1, feeling2, feeling3, feeling4, feeling5]; const dummyMyTeam = "hanhwa"; @@ -49,6 +52,7 @@ const dummyGames = [ ]; function DiaryNew() { + const navigate = useNavigate(); const [selectedDate, setSelectedDate] = useState(""); const [selectedTeam, setSelectedTeam] = useState(null); const [gameResults, setGameResults] = useState([]); @@ -57,8 +61,6 @@ function DiaryNew() { const [feeling, setFeeling] = useState(null); const [review, setReview] = useState(""); const [attendance, setAttendance] = useState(null); - - // 팀 선택 모달 상태 관리 const [isTeamModalOpen, setIsTeamModalOpen] = useState(false); const teamBoxStyle = { @@ -150,6 +152,7 @@ function DiaryNew() { 경기대상
+ {/* 내 팀은 왼쪽에 항상 표시 */}
VS
+ {/* 팀 모달에서 선택한 팀 (내 팀과 같으면 선택할 수 없음) */}
{Object.keys(teamAssets) - .filter((team) => team !== "kbo") + .filter((team) => team !== "kbo" && team !== dummyMyTeam) .map((team) => (