Skip to content

Commit 440a55a

Browse files
authored
Merge pull request #151 from InserToken/feat/1-design-yeakyung
[feat] 튜토리얼 버튼 추가
2 parents 86a6c73 + f4326da commit 440a55a

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/components/Navbar/navbar.client.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Link from "next/link";
66
import { checkUserStatus, getStock } from "@/services/userStock-service";
77
import { useAuthStore } from "@/stores/authStore";
88
import Image from "next/image";
9+
import { TutorialOverlay } from "../blocks/Tutorial/TutorialPopup.client";
910

1011
const menuItems = [
1112
{ label: "홈", href: "/" },
@@ -21,6 +22,11 @@ export default function Navbar() {
2122
const auth = useAuthStore((s) => s.auth);
2223
const clearAuth = useAuthStore((s) => s.clearAuth);
2324
const loginRequiredPaths = ["/", "/practice", "/ranking", "/mypage"];
25+
const [showTutorial, setShowTutorial] = useState(false);
26+
const handleCloseTutorial = () => {
27+
localStorage.setItem("hideTutorial", "true");
28+
setShowTutorial(false);
29+
};
2430

2531
// hydration mismatch 방지용
2632
const [mounted, setMounted] = useState(false);
@@ -162,9 +168,17 @@ export default function Navbar() {
162168
})}
163169
</ul>
164170

165-
{/* 로그인/로그아웃 버튼 */}
171+
{/* 튜토리얼, 로그인/로그아웃 버튼 */}
166172

167173
<div className="ml-auto pr-5">
174+
<button
175+
onClick={() => {
176+
setShowTutorial(true);
177+
}}
178+
className="text-sm px-4 text-[#E2E2E2] hover:text-white"
179+
>
180+
튜토리얼
181+
</button>
168182
{mounted ? (
169183
auth?.token ? (
170184
<button
@@ -186,6 +200,7 @@ export default function Navbar() {
186200
<div className="w-[64px] h-[20px]" />
187201
)}
188202
</div>
203+
{showTutorial && <TutorialOverlay onClose={handleCloseTutorial} />}
189204
</nav>
190205
);
191206
}

src/components/blocks/Tutorial/TutorialPopup.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React, { useEffect, useState } from "react";
33
import MainHomeClient from "../MainHome/MainHome.client";
44
import { useRouter } from "next/navigation";
5-
function TutorialOverlay({ onClose }) {
5+
export function TutorialOverlay({ onClose }) {
66
const [index, setIndex] = useState(0);
77
const images = [
88
"/tuto1.png",

0 commit comments

Comments
 (0)