Skip to content

Commit

Permalink
Deprecate SidebarPopup. Use it from @plone/volto
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Mar 26, 2021
1 parent 284649c commit 21c2b89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 39 deletions.
1 change: 0 additions & 1 deletion src/SidebarPopup/Readme.md

This file was deleted.

44 changes: 6 additions & 38 deletions src/SidebarPopup/SidebarPopup.jsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
import React from 'react';
import { Portal } from 'react-portal';
import { CSSTransition } from 'react-transition-group';

const DEFAULT_TIMEOUT = 500;
// TODO: add CSS transition on display

const SidebarPopup = (props, ref) => {
const { children, open } = props;
return (
<CSSTransition
in={open}
timeout={DEFAULT_TIMEOUT}
classNames="sidebar-container"
unmountOnExit
>
<Portal>
<aside
role="presentation"
onClick={(e) => {
e.stopPropagation();
}}
onKeyDown={(e) => {
e.stopPropagation();
}}
ref={ref}
key="sidebarpopup"
className="sidebar-container"
style={{ overflowY: 'auto' }}
>
{children}
</aside>
</Portal>
</CSSTransition>
);
};

export default React.forwardRef(SidebarPopup);
import { SidebarPopup } from '@plone/volto/components';
// eslint-disable-next-line no-console
console.warn(
'DEPRECATED: volto-block-style - SidebarPopup. Moved to `@plone/volto/components`',
);
export default SidebarPopup;

0 comments on commit 21c2b89

Please sign in to comment.