From f39d57d87c586df99257410e3e96937da136b51b Mon Sep 17 00:00:00 2001 From: Nirbhay Date: Thu, 14 Nov 2024 11:52:35 +0530 Subject: [PATCH] update: sidebar layout --- modules/settings/assets/js/app.js | 2 +- modules/settings/assets/js/icons/index.js | 1 + modules/settings/assets/js/icons/widget.js | 30 ++++++++++ modules/settings/assets/js/layouts/sidebar.js | 57 ++++++++++++------- 4 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 modules/settings/assets/js/icons/widget.js diff --git a/modules/settings/assets/js/app.js b/modules/settings/assets/js/app.js index 61a4850..399490c 100644 --- a/modules/settings/assets/js/app.js +++ b/modules/settings/assets/js/app.js @@ -18,7 +18,7 @@ const App = () => { return ( - { isConnected && } + { ! isConnected && } diff --git a/modules/settings/assets/js/icons/index.js b/modules/settings/assets/js/icons/index.js index d683d1c..85e89e2 100644 --- a/modules/settings/assets/js/icons/index.js +++ b/modules/settings/assets/js/icons/index.js @@ -1,2 +1,3 @@ export { ElementorLogo } from './elementor-logo'; export { SquareRoundedChevronsLeft } from './square-rounded-chevrons-left'; +export { WidgetIcon } from './widget'; diff --git a/modules/settings/assets/js/icons/widget.js b/modules/settings/assets/js/icons/widget.js new file mode 100644 index 0000000..95455e8 --- /dev/null +++ b/modules/settings/assets/js/icons/widget.js @@ -0,0 +1,30 @@ +import SvgIcon from '@elementor/ui/SvgIcon'; + +export const WidgetIcon = ( { size } ) => { + return ( + + + + + + + + ); +}; diff --git a/modules/settings/assets/js/layouts/sidebar.js b/modules/settings/assets/js/layouts/sidebar.js index 19f402e..b28429f 100644 --- a/modules/settings/assets/js/layouts/sidebar.js +++ b/modules/settings/assets/js/layouts/sidebar.js @@ -11,25 +11,28 @@ import ListItemButton from '@elementor/ui/ListItemButton'; import ListItemIcon from '@elementor/ui/ListItemIcon'; import ListItemText from '@elementor/ui/ListItemText'; import Paper from '@elementor/ui/Paper'; +import Popover from '@elementor/ui/Popover'; import Toolbar from '@elementor/ui/Toolbar'; import Typography from '@elementor/ui/Typography'; import { styled } from '@elementor/ui/styles'; -import { useState } from '@wordpress/element'; +import { useState, useRef } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; -import { ElementorLogo, SquareRoundedChevronsLeft } from '../icons'; +import { ElementorLogo, SquareRoundedChevronsLeft, WidgetIcon } from '../icons'; export const Sidebar = () => { const [ showWidgetMenu, setShowWidgetMenu ] = useState( true ); const [ openDrawer, setOpenDrawer ] = useState( true ); + const [ openMyAccountMenu, setOpenMyAccountMenu ] = useState( false ); + const anchorEl = useRef( null ); const StyledDrawer = styled( Drawer ) ` & .MuiDrawer-paper { - margin-left: 160px; - margin-top: 30px; - min-width: 80px; - max-width: 260px; - width: ${ openDrawer ? '100%' : '0' }px; - transition: all 0.3s; + position: static; + min-width: 90px; + max-width: 260px; + width: ${ openDrawer ? '100%' : '0' }px; + transition: all 0.3s; + height: 600px; }`; return ( @@ -38,7 +41,7 @@ export const Sidebar = () => { > - + { - setShowWidgetMenu( ! showWidgetMenu ) }> + setShowWidgetMenu( ! showWidgetMenu ) } sx={ { justifyContent: 'center' } } > - + @@ -83,25 +86,41 @@ export const Sidebar = () => { ) } - + - + - + - + setOpenMyAccountMenu( ! openMyAccountMenu ) }> - + + Testing +