From b873ac6f8ac142b9f7ad62e9636e2fef6152c42e Mon Sep 17 00:00:00 2001 From: Nurit Date: Thu, 12 Sep 2024 20:30:41 +0300 Subject: [PATCH] tweak admin top-bar --- .../js/components/admin-top-bar-link.js | 23 ++++++++ .../js/components/admin-top-bar-links.js | 13 +++++ .../assets/js/components/admin-top-bar.js | 55 ++++++++++--------- 3 files changed, 66 insertions(+), 25 deletions(-) create mode 100644 modules/admin/assets/js/components/admin-top-bar-link.js create mode 100644 modules/admin/assets/js/components/admin-top-bar-links.js diff --git a/modules/admin/assets/js/components/admin-top-bar-link.js b/modules/admin/assets/js/components/admin-top-bar-link.js new file mode 100644 index 00000000..33580015 --- /dev/null +++ b/modules/admin/assets/js/components/admin-top-bar-link.js @@ -0,0 +1,23 @@ +import Typography from '@elementor/ui/Typography'; +import IconButton from '@elementor/ui/IconButton'; + +export const AdminTopBarLink = ( { linkData } ) => { + const { label, hrefStr, children, color, aria } = linkData; + return ( + + { children } + + { label } + + + ); +}; diff --git a/modules/admin/assets/js/components/admin-top-bar-links.js b/modules/admin/assets/js/components/admin-top-bar-links.js new file mode 100644 index 00000000..91566599 --- /dev/null +++ b/modules/admin/assets/js/components/admin-top-bar-links.js @@ -0,0 +1,13 @@ +import Stack from '@elementor/ui/Stack'; +import { AdminTopBarLink } from './admin-top-bar-link'; + +export const AdminTopBarLinks = ( { linksData } ) => { + linksData.forEach( ( link ) => link.color = 'secondary' ); + return ( + + { + linksData.map( ( linkData, index ) => ) + } + + ); +}; diff --git a/modules/admin/assets/js/components/admin-top-bar.js b/modules/admin/assets/js/components/admin-top-bar.js index 029833db..238f39a3 100644 --- a/modules/admin/assets/js/components/admin-top-bar.js +++ b/modules/admin/assets/js/components/admin-top-bar.js @@ -1,36 +1,41 @@ -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 HomeIcon from '@elementor/icons/HomeIcon'; +import HelpIcon from '@elementor/icons/HelpIcon'; +import { AdminTopBarLinks } from './admin-top-bar-links'; +import { AdminTopBarLink } from './admin-top-bar-link'; + +const home = { + label: __( 'Hello+', 'hello-plus' ), + hrefStr: '#', + children: , + color: 'primary', + aria: 'menu', +}; + +const adminTopBarLinks = [ + { + label: 'Todo1', + hrefStr: '#', + children: , + aria: 'todo-1', + }, + { + label: 'Todo2', + hrefStr: '#', + children: , + aria: 'todo-2', + }, +]; -const AdminTopBar = () => { +export const AdminTopBar = () => { return ( - - - - - { __( 'Hello+', 'hello-plus' ) } - - - - - - TODO - - + + + ); }; - -export default AdminTopBar;