From 51eda2533af5552b5c65f67aa5c967a35a2433de Mon Sep 17 00:00:00 2001 From: Elorfin Date: Tue, 8 Feb 2022 10:09:36 +0100 Subject: [PATCH] [Home] fixes hidden tabs --- .../modules/tools/home/components/page.jsx | 2 + .../modules/tools/home/components/tabs.jsx | 96 ++++++++++--------- .../tools/home/editor/components/tab.jsx | 1 + .../tools/home/player/components/menu.jsx | 1 + .../tools/home/player/store/selectors.js | 4 +- src/plugin/home/Resources/styles/home.less | 2 +- 6 files changed, 59 insertions(+), 47 deletions(-) diff --git a/src/plugin/home/Resources/modules/tools/home/components/page.jsx b/src/plugin/home/Resources/modules/tools/home/components/page.jsx index b8172c55c2b..a4393bd646e 100644 --- a/src/plugin/home/Resources/modules/tools/home/components/page.jsx +++ b/src/plugin/home/Resources/modules/tools/home/components/page.jsx @@ -26,6 +26,7 @@ const HomePage = props => tabs={props.tabs} currentContext={props.currentContext} showSubMenu={props.showSubMenu} + showHidden={props.showHidden} /> : undefined } icon={props.currentTab && props.currentTab.icon ? @@ -77,6 +78,7 @@ const HomePage = props => HomePage.propTypes = { showSubMenu: T.bool, + showHidden: T.bool, path: T.string, breadcrumb: T.array, title: T.string.isRequired, diff --git a/src/plugin/home/Resources/modules/tools/home/components/tabs.jsx b/src/plugin/home/Resources/modules/tools/home/components/tabs.jsx index 5b7d2ac42e1..e81ed6bbebb 100644 --- a/src/plugin/home/Resources/modules/tools/home/components/tabs.jsx +++ b/src/plugin/home/Resources/modules/tools/home/components/tabs.jsx @@ -10,25 +10,26 @@ import {LinkButton} from '#/main/app/buttons/link/components/button' import {Tab as TabTypes} from '#/plugin/home/prop-types' -const Tab = ({tab, prefix, closeTab, isChild=false}) => - {tab.icon && - - } - {tab.title} - +const Tab = ({tab, prefix, closeTab, isChild = false}) => + + {tab.icon && + + } + {tab.title} + const Tabs = props => { const [expandedTab, setExpandedTab] = useState('') @@ -48,34 +49,40 @@ const Tabs = props => { } const isTabExpanded = tab => tab.id === expandedTab - const getSubtabs = (subtabs) => - - const getTabs = (tab) => { - const canShowSubTabs = !isEmpty(tab.children) && props.showSubMenu - - return
  • -
    - setExpandedTab('')} /> - {canShowSubTabs &&
    - {canShowSubTabs && isTabExpanded(tab) && getSubtabs(tab.children)} -
  • - } + const getSubtabs = (subtabs) => + return