Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[App 780] Navigation Sidebar #115

Open
wants to merge 68 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c5eeb17
Initial refactor commit
bainternet Oct 20, 2024
c641495
✅ Added build and tests CI/CD
bainternet Oct 22, 2024
c003cf7
update: add src for admin settings
nirbhayel Oct 25, 2024
21987b4
update: incorrect constant names
nirbhayel Oct 25, 2024
6333248
update: namespace
nirbhayel Oct 25, 2024
ebd2df1
add: accessibility settings
nirbhayel Oct 25, 2024
9e3bc10
update: webpack to output files inside a folder
nirbhayel Oct 28, 2024
9757cda
update: build output folders
nirbhayel Oct 29, 2024
b0dafef
update: removed commented code
nirbhayel Oct 29, 2024
2ceabd3
update: npm scripts
nirbhayel Oct 29, 2024
1a87560
add: webpack config
nirbhayel Oct 29, 2024
d0a1b8f
add: hooks
nirbhayel Oct 29, 2024
2566690
update: move admin setting to the module folder
nirbhayel Oct 29, 2024
96fec7c
update: assets loading logic
nirbhayel Oct 29, 2024
32a2057
update: add rule to move jsx props to multiline imporving readability
nirbhayel Oct 29, 2024
dcb1245
add: connect modal
nirbhayel Oct 29, 2024
a1f7b68
update: hooks import for better readability
nirbhayel Oct 29, 2024
d6d1ab6
update: replace functions with hooks
nirbhayel Oct 29, 2024
8810af3
add: connect module
nirbhayel Nov 1, 2024
d6c4efc
add: settings and get settings route
nirbhayel Nov 1, 2024
c87250b
add: hooks and contexts to get settings
nirbhayel Nov 1, 2024
7938003
add: hooks
nirbhayel Nov 1, 2024
06e8323
add: notification component
nirbhayel Nov 1, 2024
3c8845e
add: data api
nirbhayel Nov 1, 2024
b451dc5
add: settings provider and connect settings
nirbhayel Nov 1, 2024
d89b521
add: husky
nirbhayel Nov 1, 2024
3919686
Merge branch 'develop' into feature/APP-705-add-connect-module
nirbhayel Nov 7, 2024
879b72e
fix: formatting and text-domain
nirbhayel Nov 8, 2024
89e4927
update: filter names
nirbhayel Nov 8, 2024
a25f125
fix: hook import
nirbhayel Nov 8, 2024
87446dc
add: set function for settings
nirbhayel Nov 8, 2024
056464c
add: prop-types package
nirbhayel Nov 8, 2024
fc0f885
update: refactor notification component and context
nirbhayel Nov 10, 2024
e01148b
update: remove filter for authorize url
nirbhayel Nov 11, 2024
d0f8126
update: imports and exports of hooks
nirbhayel Nov 11, 2024
4b56535
update: plugin settings context filename and relevant imports
nirbhayel Nov 11, 2024
511c99c
update: icons and icon imports
nirbhayel Nov 13, 2024
1592e4f
add: sidebar(wip)
nirbhayel Nov 13, 2024
aeb12f2
update: fix width of connect screen on mobile
nirbhayel Nov 13, 2024
f39d57d
update: sidebar layout
nirbhayel Nov 14, 2024
7eb9281
merged develop
nirbhayel Nov 14, 2024
4ef1c7f
add: credit card and user arrow icons
nirbhayel Nov 14, 2024
1cf6a26
update: hidden wpfooter and fixed sidebar height
nirbhayel Nov 14, 2024
d9bb34f
update: sidebar layout
nirbhayel Nov 14, 2024
af01419
add: basic page layouts
nirbhayel Nov 15, 2024
25af085
update: sidebar layout
nirbhayel Nov 15, 2024
c06e855
add: sidebar menu, sidebar app bar and my account menu components
nirbhayel Nov 15, 2024
7e63317
update: add sidebar and menu settings
nirbhayel Nov 15, 2024
d989770
update: add page layouts
nirbhayel Nov 15, 2024
115b5a4
update: admin top bar
nirbhayel Nov 15, 2024
ab1550b
add: bottom bar
nirbhayel Nov 15, 2024
92e7de2
add: bottom bar and top bar
nirbhayel Nov 15, 2024
042568d
add: bottom bar and top bar
nirbhayel Nov 15, 2024
399e6e0
update: page content styling
nirbhayel Nov 15, 2024
28cff2d
fix: styling
nirbhayel Nov 15, 2024
e521973
fix: styling
nirbhayel Nov 15, 2024
4714c62
update: text domain
nirbhayel Nov 15, 2024
cf060e1
update: added translations
nirbhayel Nov 19, 2024
746bebf
Merge branch 'develop' into feature/APP-780-navigation-sidebar
nirbhayel Nov 25, 2024
f2cfeac
fix: admin top bar layout
nirbhayel Nov 25, 2024
a1866aa
update: exports of icons
nirbhayel Nov 25, 2024
fa0a75f
update: exports of components
nirbhayel Nov 25, 2024
9e388c2
add: aliases for imports and fix exports
nirbhayel Nov 25, 2024
8bc480f
fix: height and styling of the layout
nirbhayel Nov 25, 2024
27177fb
fix: unhide wp footer
nirbhayel Nov 25, 2024
8d2565f
update: keep widget menu open on page load (default)
nirbhayel Nov 25, 2024
eb92d9e
update: linter rules to move first prop to new line
nirbhayel Nov 26, 2024
435ab3d
update: linter rules to move first prop to new line
nirbhayel Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
"babel",
"react"
],
"settings": {
"import/resolver": {
"node": {
"paths": ["node_modules"]
},
"webpack": {
"config": "webpack.config.js"
}
}
},
"env": {
"browser": true,
"node": true,
Expand All @@ -27,6 +37,7 @@
"no-console": "off",
"react-hooks/exhaustive-deps": "off",
"react/jsx-max-props-per-line": [1, { "maximum": { "single": 2, "multi": 1 } }],
"react/jsx-first-prop-new-line": ["error", "multiline"],
"strict": [ "error", "global" ],
"curly": "warn",
"import/order": [
Expand All @@ -47,7 +58,10 @@
"caseInsensitive": false
}
}
]
],
"import/newline-after-import": ["error", {
"count": 1
}]
},
"parser": "@babel/eslint-parser"
}
15 changes: 4 additions & 11 deletions modules/settings/assets/css/style.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
body {
background: #fff;
}

.wrap {
margin-top: 0;
}

html:not([dir='rtl']) #ea11y-app {
margin-left: -20px;
background: white;
height: calc(100vh - 32px);
}

html[dir='rtl'] #ea11y-app {
margin-right: -20px;
background: white;
}

html:not([dir='rtl']) #ea11y-app-top-bar {
margin-left: -20px;
margin-bottom: 20px;
}

html[dir='rtl'] #ea11y-app-top-bar {
margin-right: -20px;
margin-bottom: 20px;
height: calc(100vh - 32px);
}

#ea11y-app * {
Expand All @@ -34,4 +27,4 @@ html[dir='rtl'] #ea11y-app-top-bar {
padding: 8px 12px;
box-shadow: none;
border-color: rgba(12, 13, 14, 0.23);
}
}
12 changes: 1 addition & 11 deletions modules/settings/assets/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
import { ThemeProvider } from '@elementor/ui/styles';
import { SettingsProvider, NotificationsProvider } from '@ea11y/hooks';
import { StrictMode, Fragment, createRoot } from '@wordpress/element';
import App from './app';
import AdminTopBar from './components/admin-top-bar';
import { PluginSettingsProvider } from './contexts/plugin-settings';
import { SettingsProvider, NotificationsProvider } from './hooks';

const rootNode = document.getElementById( 'ea11y-app' );
const topBarNode = document.getElementById( 'ea11y-app-top-bar' );

// Can't use the settings hook in the global scope so accessing directly
const isDevelopment = window?.ea11ySettingsData?.isDevelopment;
const AppWrapper = Boolean( isDevelopment ) ? StrictMode : Fragment;

const root = createRoot( rootNode );
const topBar = createRoot( topBarNode );

topBar.render(
<ThemeProvider colorScheme="light">
<AdminTopBar />
</ThemeProvider>,
);

root.render(
<AppWrapper>
Expand Down
29 changes: 27 additions & 2 deletions modules/settings/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
import '../css/style.css';
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, AdminTopBar, BottomBar } from '@ea11y/components';
import { useNotificationSettings, useSettings } from '@ea11y/hooks';
import { usePluginSettingsContext } from './contexts/plugin-settings';
import { useNotificationSettings } from './hooks';
import { Sidebar } from './layouts/sidebar';

const App = () => {
const { isConnected } = usePluginSettingsContext();
const {
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">
{ ! isConnected && <ConnectModal /> }
<Grid
display="flex"
flexDirection="row"
height="100%">
nirbhayel marked this conversation as resolved.
Show resolved Hide resolved
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it still the same, I can share prettier settings for resolve this

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add it with next PR

<Sidebar />
<Box
width="100%"
display="flex"
flexDirection="column"
justifyContent="space-between"
>
<AdminTopBar />
<Box p={ 1 } height="100%">
{ selectedChild ? selectedChild.page : selectedParent?.page }
</Box>
<BottomBar />
</Box>
</Grid>
<Notifications message={ notificationMessage } type={ notificationType } />
</ThemeProvider>
</DirectionProvider>
Expand Down
34 changes: 13 additions & 21 deletions modules/settings/assets/js/components/admin-top-bar/index.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
import HelpIcon from '@elementor/icons/HelpIcon';
import AppBar from '@elementor/ui/AppBar';
import Grid from '@elementor/ui/Grid';
import Link from '@elementor/ui/Link';
import Toolbar from '@elementor/ui/Toolbar';
import Typography from '@elementor/ui/Typography';
import { __ } from '@wordpress/i18n';
import { HELP_LINK } from '../../constants';
import ElementorLogo from '../../icons/elementor-logo';

const AdminTopBar = () => {
export const AdminTopBar = () => {
nirbhayel marked this conversation as resolved.
Show resolved Hide resolved
const toolBarStyle = {
justifyContent: 'end',
alignItems: 'center',
backgroundColor: 'background.default',
gap: '10px',
borderBottom: '1px solid rgba(0, 0, 0, 0.12)' };
return (
<AppBar position="static"
elevation={ 6 }
sx={ { boxShadow: '0px 3px 16px 0px rgba(35, 38, 42, 0.20)' } } >
<Toolbar direction="row"
sx={ { alignItems: 'center', backgroundColor: 'background.default', gap: '10px' } }
<AppBar position="static">
<Toolbar
direction="row"
sx={ toolBarStyle }
padding={ 2 }>
<Grid container={ true }
alignItems="center"
gap={ 1 }>
<ElementorLogo size="large" />
<Typography color="text.primary">
{ __( 'Accessibility', 'pojo-accessibility' ) }
</Typography>
</Grid>

<Link color="secondary"
<Link
color="secondary"
underline="hover"
href={ HELP_LINK }
target="_blank"
Expand All @@ -37,5 +31,3 @@ const AdminTopBar = () => {
</AppBar>
);
};

export default AdminTopBar;
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const AlignmentMatrixControl = () => {
{ __( 'Default Position', 'pojo-accessibility' ) }
</Typography>
</FormLabel>
<Box display="flex"
<Box
display="flex"
justifyContent="center"
padding={ 2 }
width="100%"
Expand All @@ -53,7 +54,8 @@ const AlignmentMatrixControl = () => {
width: '100px',
} }
>
{ options.map( ( option, i ) => <FormControlLabel sx={ { margin: 0 } }
{ options.map( ( option, i ) => <FormControlLabel
sx={ { margin: 0 } }
key={ i }
value={ option.value }
control={ <Radio color="secondary" /> } /> ) }
Expand Down
18 changes: 18 additions & 0 deletions modules/settings/assets/js/components/bottom-bar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Box from '@elementor/ui/Box';
import Button from '@elementor/ui/Button';
import { __ } from '@wordpress/i18n';

export const BottomBar = () => {
return (
<Box
display="flex"
justifyContent="end"
p={ 2 }
width="100%"
borderTop="1px solid rgba(0, 0, 0, 0.12)">
<Button variant="contained" color="info">
{ __( 'Save Changes', 'pojo-accessibility' ) }
</Button>
</Box>
);
};
9 changes: 6 additions & 3 deletions modules/settings/assets/js/components/color-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const ColorPicker = () => {
{ __( 'Color', 'pojo-accessibility' ) }
</Typography>
</FormLabel>
<Grid padding={ 1 }
<Grid
padding={ 1 }
border={ 1 }
borderColor="divider"
borderRadius={ 1 }
Expand All @@ -30,11 +31,13 @@ const ColorPicker = () => {
className="widget-settings-color-picker"
/>
<Grid marginTop={ 2 } display="flex">
<Box padding={ 2 }
<Box
padding={ 2 }
sx={ { backgroundColor: color } }
borderRadius={ 1 }
marginRight={ 1 }></Box>
<HexColorInput color={ color }
<HexColorInput
color={ color }
onChange={ setColor }
style={ {
width: '100%',
Expand Down
Loading
Loading