Skip to content

Commit

Permalink
Sync branch [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate-bot authored Jun 3, 2024
2 parents 699d182 + 610593f commit 184b2e3
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"neve_ran_builder_migration": true,
"neve_migrated_builders": true,
"neve_ran_migrations": true,
"neve_had_old_skin": true,
"neve_migrated_hfg_colors": true,
"nav_menu_locations": {
"primary": 176
},
"hfg_header_layout_v2": "{\"desktop\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[{\"id\":\"secondary-menu\"}]},\"main\":{\"left\":[{\"id\":\"logo\"}],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]}},\"mobile\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"main\":{\"left\":[{\"id\":\"logo\"}],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[{\"id\":\"nav-icon\"}]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"sidebar\":[{\"id\":\"secondary-menu\"}]}}\";}",
"neve_new_skin": "new"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { test, expect } from '@playwright/test';
import { setCustomizeSettings } from '../../../utils';
import secondaryMenuSetup from '../../../fixtures/customizer/hfg/hfg-secondary-menu-component.json';

test.describe('Secondary Nav', async () => {
test('Mobile Sidebar Opening', async ({ page, request, baseURL }) => {
await setCustomizeSettings('hfgSearchFormIcon', secondaryMenuSetup, {
request,
baseURL,
});
await page.goto('/?test_name=hfgSecondaryNav');

await page.setViewportSize({ width: 375, height: 812 }); // Mobile Mode.

await page.getByRole('button', { name: 'Navigation Menu' }).click();

await expect(page.locator('#header-menu-sidebar-inner')).toBeVisible(); // Secondary_Nav_Walker enqueues the necessary JS to make the menu work.
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'fallback_cb' => '__return_false',
'before' => '<div class="wrap">',
'after' => '</div>',
'walker' => '\Neve\Views\Secondary_Nav_Walker',
)
);
?>
Expand Down
26 changes: 26 additions & 0 deletions inc/views/secondary_nav_walker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Custom navwalker for secondary menu.
*
* Author: Soare Robert <[email protected]>
* Created on: 25/04/2024
*
* @package Neve\Views
*/

namespace Neve\Views;

/**
* Class Secondary_Nav_Walker
*
* @package Neve\Views
*/
class Secondary_Nav_Walker extends Nav_Walker {

/**
* Secondary_Nav_Walker constructor.
*/
public function __construct() {
add_action( 'neve_after_header_wrapper_hook', [ $this, 'inline_style_for_sidebar' ], 9 );
}
}

0 comments on commit 184b2e3

Please sign in to comment.