Skip to content

Commit

Permalink
(#23) 🐰 οΏ½EUNHAK: ꡬ역 κ°€μ΄λ“œ νŽ˜μ΄μ§€ κ΅¬ν˜„ 및 머지
Browse files Browse the repository at this point in the history
ꡬ역 κ°€μ΄λ“œμ—μ„œ 초기 νŽ˜μ΄μ§€μ™€ ν•΄λ‹Ή μ’Œμ„ λ²„νŠΌμ„ ν΄λ¦­ν•˜μ˜€μ„ λ•Œ μ΄λ™ν•˜λŠ” 상세 νŽ˜μ΄μ§€λ₯Ό κ΅¬ν˜„ν•œλ‹€.
  • Loading branch information
2unhi authored Nov 6, 2024
2 parents 4d25330 + 1808a09 commit 6e976b4
Show file tree
Hide file tree
Showing 21 changed files with 269 additions and 20 deletions.
14 changes: 14 additions & 0 deletions src/assets/svg/guide_jamsil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/svg/guide_ktwiz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/svg/tip_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image';

import backLeftButtonGrayIcon from '../../../assets/webp/back_left_button_gray.webp';
import backLeftButtonGrayIcon from '../../assets/webp/back_left_button_gray.webp';

const BackBar = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image';

import logoIcon from '../../../assets/svg/hitzone_logo.svg';
import backLeftButtonGrayIcon from '../../../assets/webp/back_left_button_gray.webp';
import logoIcon from '../../assets/svg/hitzone_logo.svg';
import backLeftButtonGrayIcon from '../../assets/webp/back_left_button_gray.webp';

const BackBar = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image';

import backLeftButtonGrayIcon from '../../../assets/webp/back_left_button_gray.webp';
import closeButtonGrayIcon from '../../../assets/webp/close_button_gray.webp';
import backLeftButtonGrayIcon from '../../assets/webp/back_left_button_gray.webp';
import closeButtonGrayIcon from '../../assets/webp/close_button_gray.webp';


interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image';

import closeButtonGrayIcon from '../../../assets/webp/close_button_gray.webp';
import closeButtonGrayIcon from '../../assets/webp/close_button_gray.webp';


interface Props {
Expand Down
19 changes: 19 additions & 0 deletions src/components/layout/HeaderCenter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import Image from 'next/image';
import Link from 'next/link';

import logoIcon from '../../assets/svg/hitzone_logo.svg';

const BackBar = () => {
return (
<div className="flex pb-[14px] border-b border-grayscale-10">
<div className="flex justify-center w-full">
<Link href="/">
<Image src={logoIcon} alt="Logo" width={154} height={27} />
</Link>
</div>
</div>
);
}

export default BackBar;
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/Culture/Culture.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import Header from "../../components/layout/Header";
import Header from "../../components/layout/MainHeader";
import NavBar from "../../components/layout/NavBar";

const Culture = () => {
Expand Down
86 changes: 81 additions & 5 deletions src/pages/Guide/Guide.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,90 @@
import React from "react";
import Header from "../../components/layout/Header";
import React, { useState } from "react";
import Image from "next/image";
import Header from "../../components/layout/HeaderCenter";
import NavBar from "../../components/layout/NavBar";
import Dropdown from "../Main/components/Dropdown";
import GuideDetailContent from "./components/GuideDetailContent";
import guideJamsil from "../../assets/svg/guide_jamsil.svg";
import jamsilRed from "../../assets/svg/seat/jamsil_red.svg";

// μ˜ˆμ‹œ 데이터 (μž μ‹€μ’…ν•©μš΄λ™μž₯ - λ ˆλ“œμ„)
const dummyData = {
title: "λ ˆλ“œμ„",
image: jamsilRed,
description: "ν•΄λ‹Ή ꡬ역은 λ‹€μ–‘ν•œ 것듀을 λͺ¨λ‘ 적절히 즐길 수 μžˆλŠ” κ΅¬μ—­μ΄μ—μš”.",
gateInfo: "[1루] 2-3 Gate [3루] 2-1 Gate",
stepInfo: "[1루] μ•½ 24~30cm(10μ—΄), μ•½ 33~38cm(20μ—΄) / [3루] μ•½ 24~30cm(1nnμ—΄), μ•½ 33~38cm(22μ—΄)",
seatSpaceInfo: "[1루] μ•½ 25cm [3루] μ•½ 25cm",
};

const Guide = () => {
const [selectedStadium, setSelectedStadium] = useState<string>("μž μ‹€μ’…ν•©μš΄λ™μž₯ (μž μ‹€)");
const [selectedSection, setSelectedSection] = useState<string | null>(null);

const handleStadiumSelect = (stadium: string) => {
setSelectedStadium(stadium);
setSelectedSection(null);
};

const handleSectionClick = (sectionName: string) => {
setSelectedSection(sectionName);
};

const stadiumInfo = {
image: guideJamsil,
description: "μ„œμšΈμ˜ μžμ‘΄μ‹¬, LG 트윈슀 / 미라클 두산, 두산 λ² μ–΄μŠ€",
sections: [
{ color: "bg-jamsil-red", name: "λ ˆλ“œμ„" },
{ color: "bg-jamsil-blue", name: "블루석" },
{ color: "bg-jamsil-orange", name: "μ˜€λ Œμ§€μ„" },
{ color: "bg-jamsil-navy", name: "넀이비석" },
{ color: "bg-jamsil-premium", name: "프리미엄석" },
{ color: "bg-jamsil-table", name: "ν…Œμ΄λΈ”μ„" },
{ color: "bg-jamsil-exciting", name: "μ΅μ‚¬μ΄νŒ…μ‘΄" },
{ color: "bg-jamsil-green", name: "외야그린석" },
],
};

return (
<div>
<div className="flex flex-col h-screen">
<Header />
<div className="p-4">
<h1>ꡬ역 κ°€μ΄λ“œ</h1>

<div className="flex-1 overflow-y-auto mt-[15px]">
{selectedSection ? (
<div>
<GuideDetailContent {...dummyData} />
</div>
) : (
<>
<Dropdown options={["μž μ‹€μ’…ν•©μš΄λ™μž₯ (μž μ‹€)"]} selectedOption={selectedStadium} onSelect={handleStadiumSelect} />
<div className="mt-4">
<Image
src={stadiumInfo.image}
alt={`${selectedStadium} 이미지`}
className="w-full h-auto rounded-lg"
width={370}
height={198}
/>
<p className="text-center text-sm font-medium text-gray-700 mt-2">{stadiumInfo.description}</p>
</div>

<h2 className="mt-6 text-lg font-bold text-left text-gray-700">κΆκΈˆν•˜μ‹  ꡬ역을 μ„ νƒν•΄μ£Όμ„Έμš”!</h2>
<div className="grid grid-cols-2 gap-4 mt-4">
{stadiumInfo.sections.map((section) => (
<button
key={section.name}
className="flex items-center justify-start h-12 bg-gray-100 rounded-lg"
onClick={() => handleSectionClick(section.name)}
>
<div className={`w-3 h-3 rounded-sm ml-3 mr-2 ${section.color}`} />
<span className="text-gray-700 text-sm font-medium">{section.name}</span>
</button>
))}
</div>
</>
)}
</div>

<NavBar />
</div>
);
Expand Down
74 changes: 74 additions & 0 deletions src/pages/Guide/components/GuideDetailContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from "react";
import Image from "next/image";
import StadiumInfo from "../../Main/components/StadiumInfo";
import SeatDropdown from "./SeatDropdown";
import tipIcon from "../../../assets/svg/tip_button.svg";

interface GuideDetailContentProps {
title: string;
image: string;
description: string;
gateInfo: string;
stepInfo: string;
seatSpaceInfo: string;
}

export default function GuideDetailContent({
title,
image,
description,
gateInfo,
stepInfo,
seatSpaceInfo,
}: GuideDetailContentProps) {
// 곡톡 클래슀 μ •μ˜
const containerClass = "bg-grayscale-0 p-3 rounded-lg";
const sectionTitleClass = "text-sm font-semibold text-grayscale-80 bg-gray-100 px-2 py-1 rounded inline-block";
const sectionContentClass = "text-sm font-regular text-black mt-2";

return (
<div className="relative mb-[84px]">
{/* μ’Œμ„ 선택 λ“œλ‘­λ‹€μš΄ 및 Tip λ²„νŠΌ */}
<div className="flex items-center mb-4">
<SeatDropdown
options={["λ ˆλ“œμ„", "블루석", "μ˜€λ Œμ§€μ„", "넀이비석", "프리미엄석", "ν…Œμ΄λΈ”μ„", "μ΅μ‚¬μ΄νŒ…μ„", "외야그린석"]}
selectedOption={title}
onSelect={(option) => console.log(option)}
/>
<button className="ml-auto w-[54px] h-[30px] flex items-center justify-center">
<Image src={tipIcon} alt="Tip" width={54} height={30} />
</button>
</div>

{/* 야ꡬμž₯ μ’Œμ„ 이미지 */}
<div className="relative">
<Image src={image} alt={`${title} 이미지`} className="w-full rounded-lg" width={370} height={198} />
</div>

{/* ꡬμž₯ 정보 */}
<StadiumInfo stadium={title} />

<div className="bg-grayscale-5 p-4 rounded-lg mt-4">
{/* 상단 타이틀 μ„Ήμ…˜ */}
<div className={containerClass}>
<h2 className="text-lg font-bold">{title}</h2>
<p className="text-sm text-gray-700 mt-2">{description}</p>
</div>

{/* μ„ΈλΆ€ 정보 μ„Ήμ…˜ */}
<div className={`${containerClass} mt-3 space-y-4`}>
{[
{ title: "μΆœμž…κ΅¬ μœ„μΉ˜", content: gateInfo },
{ title: "단차 정보", content: stepInfo },
{ title: "μ’Œμ„ κ°„ 간격 (무릎 간격) 정보", content: seatSpaceInfo },
].map((section, index) => (
<div key={index}>
<h3 className={sectionTitleClass}>{section.title}</h3>
<p className={sectionContentClass}>{section.content}</p>
</div>
))}
</div>
</div>
</div>
);
}
50 changes: 50 additions & 0 deletions src/pages/Guide/components/SeatDropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React, { useState } from "react";
import Image from "next/image";
import stadiumDropdownIcon from "../../../assets/webp/stadium_dropdown.webp";

interface SeatDropdownProps {
options: string[];
selectedOption: string;
onSelect: (option: string) => void;
}

export default function SeatDropdown({ options, selectedOption, onSelect }: SeatDropdownProps) {
const [isDropdownOpen, setIsDropdownOpen] = useState(false);

const toggleDropdown = () => setIsDropdownOpen(!isDropdownOpen);

return (
<div className="relative w-[220px]">
<button
onClick={toggleDropdown}
className="flex items-center justify-between py-[6px] px-3 border border-gray-300 rounded-lg w-full h-[36px] text-md font-semibold text-gray-800"
>
<span>{selectedOption || "ꡬ역을 μ„ νƒν•˜μ„Έμš”"}</span>
<Image src={stadiumDropdownIcon} alt="dropdown icon" width={16} height={16} />
</button>

{isDropdownOpen && (
<div className="absolute left-0 w-full mt-2 bg-white shadow-lg text-sm z-10 rounded-lg">
<ul className="list-none max-h-60 overflow-y-auto">
{options.map((option, index) => (
<li
key={option}
onClick={() => {
onSelect(option);
setIsDropdownOpen(false);
}}
className={`px-4 py-[10px] cursor-pointer ${
option === selectedOption ? "bg-red-500 text-white font-semibold" : "text-gray-800"
} ${index === 0 ? "rounded-t-lg" : ""} ${index === options.length - 1 ? "rounded-b-lg" : ""} ${
option !== selectedOption ? "hover:bg-gray-100" : ""
}`}
>
{option}
</li>
))}
</ul>
</div>
)}
</div>
);
}
2 changes: 1 addition & 1 deletion src/pages/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
import { useSession } from "next-auth/react";
import { useRouter } from "next/router";

import Header from "../../components/layout/Header";
import Header from "../../components/layout/MainHeader";
import NavBar from "../../components/layout/NavBar";
import BignnerGuide from "../../components/chips/BignnerGuide";
import BignnerGuideDialog from "../../components/dialogs/BignnerGuideDialog";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyPage/MyPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import Header from "../../components/layout/Header";
import Header from "../../components/layout/MainHeader";
import NavBar from "../../components/layout/NavBar";

const MyPage = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Onboarding/Signup/SignupPage1.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import BackBar from "../components/BackBar"
import BackBar from "../../../components/layout/BackBar"
import { Props } from "./SignupPage";

import Image from 'next/image';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Onboarding/Signup/SignupPage2.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import BackBar from "../components/BackBar"
import BackBar from "../../../components/layout/BackBar"
import { Props } from "./SignupPage";

import AlarmQuestionDialog from "../../../components/dialogs/AlarmQuestionDialog"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Onboarding/Signup/SignupPage3.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import BackLogoBar from "../components/BackLogoBar"
import BackLogoBar from "../../../components/layout/BackLogoBar"
import { Props } from "./SignupPage";

import Image from 'next/image';
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Recommendation/Question.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from "react";
import { useRouter } from "next/router";

import HeaderBar from "./Question/HeaderBar";
import HeaderBackBar from "./Question/HeaderBackBar";
import HeaderBar from "../../components/layout/HeaderBar";
import HeaderBackBar from "../../components/layout/HeaderBackBar";
import Question1 from "./Question/Question1";
import Question2 from "./Question/Question2";
import Question3 from "./Question/Question3";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Recommendation/Result.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { useRouter } from "next/router";

import HeaderBar from "./Result/HeaderBar";
import HeaderBar from "../../components/layout/ResultHeader";
import Question1 from "./Question/Question1";
import Question2 from "./Question/Question2";
import Question3 from "./Question/Question3";
Expand Down

0 comments on commit 6e976b4

Please sign in to comment.