Skip to content

Commit

Permalink
fix: Drawer does not close (by lemattma)
Browse files Browse the repository at this point in the history
Passing `open` to the Styled component doesn't refresh the `transform` CSS property.

Resolves: Issue byteyilabs#106
  • Loading branch information
letuanhai committed Oct 15, 2023
1 parent e9a4496 commit c3b5906
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/extension/src/ui/containers/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ const App = () => {
}, [getPlayer, history, open, pathname]);

return (
<StyledDrawer open={open} className={open && 'panel-shadow'}>
<StyledDrawer
// fixes toggling the drawer open and closed.
// For some reason passing `open` doesn't update the component's styles
style={{ transform: open ? 'translateX(0)' : 'translateX(100%)' }}
open={open}
className={open && 'panel-shadow'}
>
<Grid container>
<Header />
<StyledViewWrapper>
Expand Down

0 comments on commit c3b5906

Please sign in to comment.