From d35f6b7da203f8ef95f6c9cf4306cd568bd552c2 Mon Sep 17 00:00:00 2001 From: evgeniywas Date: Sun, 4 Jun 2023 18:20:46 +0100 Subject: [PATCH] refactor: clear layout1 --- src/app/theme-layouts/layout1/Layout1.js | 26 +---- .../theme-layouts/layout1/Layout1Config.js | 65 +---------- .../layout1/components/FooterLayout1.js | 33 ------ .../layout1/components/LeftSideLayout1.js | 7 -- .../components/NavbarWrapperLayout1.js | 2 +- .../layout1/components/RightSideLayout1.js | 15 --- .../layout1/components/ToolbarLayout1.js | 103 ------------------ 7 files changed, 4 insertions(+), 247 deletions(-) delete mode 100644 src/app/theme-layouts/layout1/components/FooterLayout1.js delete mode 100644 src/app/theme-layouts/layout1/components/LeftSideLayout1.js delete mode 100644 src/app/theme-layouts/layout1/components/RightSideLayout1.js delete mode 100644 src/app/theme-layouts/layout1/components/ToolbarLayout1.js diff --git a/src/app/theme-layouts/layout1/Layout1.js b/src/app/theme-layouts/layout1/Layout1.js index e9e1600..a77107b 100644 --- a/src/app/theme-layouts/layout1/Layout1.js +++ b/src/app/theme-layouts/layout1/Layout1.js @@ -1,18 +1,13 @@ import FuseDialog from '@fuse/core/FuseDialog'; -import { styled } from '@mui/material/styles'; import FuseMessage from '@fuse/core/FuseMessage'; import FuseSuspense from '@fuse/core/FuseSuspense'; +import { styled } from '@mui/material/styles'; import AppContext from 'app/AppContext'; +import { selectFuseCurrentLayoutConfig } from 'app/store/fuse/settingsSlice'; import { memo, useContext } from 'react'; import { useSelector } from 'react-redux'; import { useRoutes } from 'react-router-dom'; -import { selectFuseCurrentLayoutConfig } from 'app/store/fuse/settingsSlice'; -import FooterLayout1 from './components/FooterLayout1'; -import LeftSideLayout1 from './components/LeftSideLayout1'; import NavbarWrapperLayout1 from './components/NavbarWrapperLayout1'; -import RightSideLayout1 from './components/RightSideLayout1'; -import ToolbarLayout1 from './components/ToolbarLayout1'; -import SettingsPanel from '../shared-components/SettingsPanel'; const Root = styled('div')(({ theme, config }) => ({ ...(config.mode === 'boxed' && { @@ -37,20 +32,10 @@ function Layout1(props) { return ( - {config.leftSidePanel.display && } -
{config.navbar.display && config.navbar.position === 'left' && }
- {config.toolbar.display && ( - - )} - -
- -
-
@@ -58,16 +43,9 @@ function Layout1(props) { {props.children}
- - {config.footer.display && ( - - )}
- - {config.navbar.display && config.navbar.position === 'right' && }
- {config.rightSidePanel.display && }
); diff --git a/src/app/theme-layouts/layout1/Layout1Config.js b/src/app/theme-layouts/layout1/Layout1Config.js index d511014..379ff09 100644 --- a/src/app/theme-layouts/layout1/Layout1Config.js +++ b/src/app/theme-layouts/layout1/Layout1Config.js @@ -1,5 +1,5 @@ const config = { - title: 'Layout 1 - Vertical', + title: 'Layout 1 - Dashboard', defaults: { mode: 'container', containerWidth: 1570, @@ -9,20 +9,6 @@ const config = { folded: true, position: 'left', }, - toolbar: { - display: true, - style: 'fixed', - }, - footer: { - display: true, - style: 'fixed', - }, - leftSidePanel: { - display: true, - }, - rightSidePanel: { - display: true, - }, }, form: { mode: { @@ -47,7 +33,6 @@ const config = { title: 'Container Width (px)', type: 'number', }, - navbar: { type: 'group', title: 'Navbar', @@ -98,54 +83,6 @@ const config = { }, }, }, - toolbar: { - type: 'group', - title: 'Toolbar', - children: { - display: { - title: 'Display', - type: 'switch', - }, - style: { - title: 'Style', - type: 'radio', - options: [ - { - name: 'Fixed', - value: 'fixed', - }, - { - name: 'Static', - value: 'static', - }, - ], - }, - }, - }, - footer: { - type: 'group', - title: 'Footer', - children: { - display: { - title: 'Display', - type: 'switch', - }, - style: { - title: 'Style', - type: 'radio', - options: [ - { - name: 'Fixed', - value: 'fixed', - }, - { - name: 'Static', - value: 'static', - }, - ], - }, - }, - }, }, }; diff --git a/src/app/theme-layouts/layout1/components/FooterLayout1.js b/src/app/theme-layouts/layout1/components/FooterLayout1.js deleted file mode 100644 index 782d9af..0000000 --- a/src/app/theme-layouts/layout1/components/FooterLayout1.js +++ /dev/null @@ -1,33 +0,0 @@ -import AppBar from '@mui/material/AppBar'; -import { ThemeProvider } from '@mui/material/styles'; -import Toolbar from '@mui/material/Toolbar'; -import { memo } from 'react'; -import { useSelector } from 'react-redux'; -import { selectFooterTheme } from 'app/store/fuse/settingsSlice'; -import clsx from 'clsx'; - -function FooterLayout1(props) { - const footerTheme = useSelector(selectFooterTheme); - - return ( - - - theme.palette.mode === 'light' - ? footerTheme.palette.background.paper - : footerTheme.palette.background.default, - }} - > - - Footer - - - - ); -} - -export default memo(FooterLayout1); diff --git a/src/app/theme-layouts/layout1/components/LeftSideLayout1.js b/src/app/theme-layouts/layout1/components/LeftSideLayout1.js deleted file mode 100644 index 9676c86..0000000 --- a/src/app/theme-layouts/layout1/components/LeftSideLayout1.js +++ /dev/null @@ -1,7 +0,0 @@ -import { memo } from 'react'; - -function LeftSideLayout1() { - return <>; -} - -export default memo(LeftSideLayout1); diff --git a/src/app/theme-layouts/layout1/components/NavbarWrapperLayout1.js b/src/app/theme-layouts/layout1/components/NavbarWrapperLayout1.js index e15855a..a8792f3 100644 --- a/src/app/theme-layouts/layout1/components/NavbarWrapperLayout1.js +++ b/src/app/theme-layouts/layout1/components/NavbarWrapperLayout1.js @@ -25,7 +25,7 @@ function NavbarWrapperLayout1(props) { - {config.navbar.display && !config.toolbar.display && !navbar.open && } + {config.navbar.display && !navbar.open && } ); } diff --git a/src/app/theme-layouts/layout1/components/RightSideLayout1.js b/src/app/theme-layouts/layout1/components/RightSideLayout1.js deleted file mode 100644 index 50a8e61..0000000 --- a/src/app/theme-layouts/layout1/components/RightSideLayout1.js +++ /dev/null @@ -1,15 +0,0 @@ -import { memo } from 'react'; -import QuickPanel from '../../shared-components/quickPanel/QuickPanel'; -import NotificationPanel from '../../shared-components/notificationPanel/NotificationPanel'; - -function RightSideLayout1(props) { - return ( - <> - - - - - ); -} - -export default memo(RightSideLayout1); diff --git a/src/app/theme-layouts/layout1/components/ToolbarLayout1.js b/src/app/theme-layouts/layout1/components/ToolbarLayout1.js deleted file mode 100644 index 436c0a4..0000000 --- a/src/app/theme-layouts/layout1/components/ToolbarLayout1.js +++ /dev/null @@ -1,103 +0,0 @@ -import { ThemeProvider } from '@mui/material/styles'; -import AppBar from '@mui/material/AppBar'; -import Hidden from '@mui/material/Hidden'; -import Toolbar from '@mui/material/Toolbar'; -import clsx from 'clsx'; -import { memo } from 'react'; -import { useSelector } from 'react-redux'; -import { selectFuseCurrentLayoutConfig, selectToolbarTheme } from 'app/store/fuse/settingsSlice'; -import { selectFuseNavbar } from 'app/store/fuse/navbarSlice'; -import AdjustFontSize from '../../shared-components/AdjustFontSize'; -import FullScreenToggle from '../../shared-components/FullScreenToggle'; -import LanguageSwitcher from '../../shared-components/LanguageSwitcher'; -import NotificationPanelToggleButton from '../../shared-components/notificationPanel/NotificationPanelToggleButton'; -import NavigationShortcuts from '../../shared-components/NavigationShortcuts'; -import NavigationSearch from '../../shared-components/NavigationSearch'; -import NavbarToggleButton from '../../shared-components/NavbarToggleButton'; -import UserMenu from '../../shared-components/UserMenu'; -import QuickPanelToggleButton from '../../shared-components/quickPanel/QuickPanelToggleButton'; -import ChatPanelToggleButton from '../../shared-components/chatPanel/ChatPanelToggleButton'; - -function ToolbarLayout1(props) { - const config = useSelector(selectFuseCurrentLayoutConfig); - const navbar = useSelector(selectFuseNavbar); - const toolbarTheme = useSelector(selectToolbarTheme); - - return ( - - - theme.palette.mode === 'light' - ? toolbarTheme.palette.background.paper - : toolbarTheme.palette.background.default, - }} - position="static" - > - -
- {config.navbar.display && config.navbar.position === 'left' && ( - <> - - {(config.navbar.style === 'style-3' || - config.navbar.style === 'style-3-dense') && ( - - )} - - {config.navbar.style === 'style-1' && !navbar.open && ( - - )} - - - - - - - )} - - - - -
- -
- - - - - - - - - - - - - - - - - -
- - {config.navbar.display && config.navbar.position === 'right' && ( - <> - - {!navbar.open && } - - - - - - - )} -
-
-
- ); -} - -export default memo(ToolbarLayout1);