Skip to content

Commit

Permalink
simplify panel collapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
culdo committed Dec 28, 2024
1 parent e2b0b37 commit 1e3e570
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/components/panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@ function Panel() {
const hidden = !presetReady || gui.hidden
const [collapsed, setCollapsed] = useState(false)

function handleWindowSizeChange() {
useEffect(() => {
if (window.innerWidth < 1000) {
setCollapsed(true)
}
}
useEffect(() => {
window.addEventListener('resize', handleWindowSizeChange);
return () => {
window.removeEventListener('resize', handleWindowSizeChange);
}
}, []);

return (
Expand Down

0 comments on commit 1e3e570

Please sign in to comment.