Skip to content

Commit

Permalink
feat: 이모지 버튼 클릭으로 playingState를 stale로 초기화
Browse files Browse the repository at this point in the history
  • Loading branch information
Bumang-Cyber committed Mar 12, 2024
1 parent 02b0e14 commit efd6ea5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Game/StatusPanel/RestartEmojiPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import usePlayingSwitch from "@/hooks/usePlayingSwitch";
import styled from "styled-components";

const RestartEmojiPanel = () => {
return <RestartEmojiContainer>🙂</RestartEmojiContainer>;
const { currentPlayingState, playingSwitchHandler } = usePlayingSwitch();

const clickEmojiHander = () => {
if (currentPlayingState === "stale") return;
playingSwitchHandler("stale");
};

return <RestartEmojiContainer onClick={clickEmojiHander}>🙂</RestartEmojiContainer>;
};

export default RestartEmojiPanel;
Expand Down

0 comments on commit efd6ea5

Please sign in to comment.