Skip to content

Commit

Permalink
feat: 레벨 바뀔 때마다 드롭다운 메뉴 visible: false로 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
Bumang-Cyber committed Mar 12, 2024
1 parent 8780f9a commit 573f80b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/components/Game/TileMapPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import useLevelSwitch from "../../../hooks/useLevelSwitch";

const TileMapPanel = () => {
const { currentLevelStatus } = useLevelSwitch();
console.log(currentLevelStatus, "currentLevelStatus");
const { X, Y } = currentLevelStatus;

const tileMapArr = generateTileMap(X, Y);
console.log(tileMapArr);

return (
<TileMapContainer>
Expand Down
8 changes: 6 additions & 2 deletions src/components/Option/Dropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { useState } from "react";
import { useEffect, useState } from "react";
import styled from "styled-components";

import { type LevelKeyType } from "../../../types/level";
import { FaCheck } from "react-icons/fa";
import useLevelSwitch from "../../../hooks/useLevelSwitch";

const Dropdown = () => {
const { currentLevel, levelSwitchHandler, levelKeys } = useLevelSwitch();

const [isVisible, setIsVisible] = useState(false);

const switchVisibleHandler = () => {
setIsVisible((prev) => !prev);
};

const { currentLevel, levelSwitchHandler, levelKeys } = useLevelSwitch();
useEffect(() => {
setIsVisible(false);
}, [currentLevel]);

return (
<Wrapper>
Expand Down
Empty file.

0 comments on commit 573f80b

Please sign in to comment.