Skip to content

Commit

Permalink
update: add page layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbhayel committed Nov 15, 2024
1 parent 7e63317 commit d989770
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions modules/settings/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import '../css/style.css';
import Container from '@elementor/ui/Container';
import Box from '@elementor/ui/Box';
import DirectionProvider from '@elementor/ui/DirectionProvider';
import Grid from '@elementor/ui/Grid';
import { ThemeProvider } from '@elementor/ui/styles';
import { ConnectModal, Notifications } from './components';
import { ConnectModal, Notifications, MenuItems } from './components';
import { usePluginSettingsContext } from './contexts/plugin-settings';
import { useNotificationSettings } from './hooks';
import { useNotificationSettings, useSettings } from './hooks';
import { Sidebar } from './layouts/sidebar';

const App = () => {
Expand All @@ -14,7 +14,11 @@ const App = () => {
notificationMessage,
notificationType,
} = useNotificationSettings();
const { selectedMenu } = useSettings();

// Accessing the selected menu item
const selectedParent = MenuItems[ selectedMenu.parent ];
const selectedChild = selectedMenu.child ? selectedParent.children[ selectedMenu.child ] : null;
return (
<DirectionProvider rtl={ false /* TODO:Add RTL detection in settings */ }>
<ThemeProvider colorScheme="light">
Expand All @@ -23,7 +27,9 @@ const App = () => {
flexDirection="row"
height="100%">
<Sidebar />
<Container>Page</Container>
<Box>
{ selectedChild ? selectedChild.page : selectedParent?.page }
</Box>
</Grid>
<Notifications message={ notificationMessage } type={ notificationType } />
</ThemeProvider>
Expand Down

0 comments on commit d989770

Please sign in to comment.