Skip to content

Commit

Permalink
fix(Drawer): fix animation (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGenius authored Sep 22, 2023
1 parent 191d3ac commit 45d57c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ export interface DrawerItemProps {

export const DrawerItem: React.FC<DrawerItemProps> = ({visible, content, direction, className}) => {
const itemRef = React.useRef<HTMLDivElement>(null);
const cssDirection = direction === 'left' ? undefined : direction;

return (
<CSSTransition
in={visible}
timeout={TIMEOUT}
unmountOnExit={true}
classNames={b('item-transition', {direction})}
classNames={b('item-transition', {direction: cssDirection})}
nodeRef={itemRef}
>
<div ref={itemRef} className={b('item', {direction}, className)}>
<div ref={itemRef} className={b('item', {direction: cssDirection}, className)}>
{content}
</div>
</CSSTransition>
Expand Down

0 comments on commit 45d57c2

Please sign in to comment.