From 342feb90caa3bf6fd17a111aebd4e79203fbafd0 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Thu, 15 Aug 2019 11:38:55 -0400 Subject: [PATCH] Updated sidebar menu item placement added body class to to stop scroll when sidebar menu is open --- .../gabsocial/components/sidebar_menu.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/javascript/gabsocial/components/sidebar_menu.js b/app/javascript/gabsocial/components/sidebar_menu.js index 9fc45262..d24961ea 100644 --- a/app/javascript/gabsocial/components/sidebar_menu.js +++ b/app/javascript/gabsocial/components/sidebar_menu.js @@ -57,6 +57,14 @@ class SidebarMenu extends ImmutablePureComponent { onClose: PropTypes.func.isRequired, }; + componentDidUpdate () { + if (this.props.sidebarOpen) { + document.body.classList.add('with-modals--active'); + } else { + document.body.classList.remove('with-modals--active'); + } + } + render () { const { sidebarOpen, onClose, intl, account } = this.props; const acct = account.get('acct'); @@ -120,6 +128,10 @@ class SidebarMenu extends ImmutablePureComponent {