Skip to content

Commit

Permalink
fix: 전체화면 취소시 <>버튼 안생김
Browse files Browse the repository at this point in the history
  • Loading branch information
5nxtnxtnxt committed Dec 13, 2023
1 parent 70140af commit b64c2b7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions front/src/pages/Main/MainButtonBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,20 @@ const screenTime = (
}, 1000);
};

const uiOn = (setScreen: React.Dispatch<React.SetStateAction<boolean>>) => {
const uiOn = (
setScreen: React.Dispatch<React.SetStateAction<boolean>>,
refs: Array<React.RefObject<HTMLDivElement>>
) => {
const music = document.getElementById('musicController');
music ? (music.style.display = 'block') : null;

const prev = document.getElementById('prevBtn');
prev ? (prev.style.display = 'block') : null;

refs.forEach(ref => {
if (ref.current) {
ref.current.style.setProperty('animation', `fadeInUp 0s forwards`);
}
});
setScreen(false);
};

Expand Down Expand Up @@ -258,7 +265,9 @@ const MainButtonBox = (props: MainButtonBoxProps) => {
) : null}
</>
) : (
<EmptyDiv onClick={() => uiOn(setScreen)} />
<EmptyDiv
onClick={() => uiOn(setScreen, [props.leftArrow, props.rightArrow])}
/>
)}
</>
);
Expand Down

0 comments on commit b64c2b7

Please sign in to comment.