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

Add navigation menu dropdown component #464

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Sep 1, 2022

Adds a simple component for navigation menu dropdowns. While it's not automatically generated in the code as of yet, it gives a quick way to add a dropdown to published views.

I actually can't think of a good way to implement automatic dropdowns in a way that works well without a bunch of complexity. The best I can see now is to add a Blade component that can be used in published views, and we'll take it from there. #76 (comment)

Here is an example usage:

@php
  $navigation = \Hyde\Framework\Models\NavigationMenu::create();
@endphp

<x-hyde::navigation.dropdown label="About us">
  @foreach ($navigation->items as $item)
    <li>
      @include('hyde::components.navigation.navigation-link')
    </li>
  @endforeach
</x-hyde::navigation.dropdown>

@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #464 (118e5c6) into master (a088804) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #464   +/-   ##
=========================================
  Coverage     99.60%   99.60%           
  Complexity      923      923           
=========================================
  Files           109      109           
  Lines          2277     2277           
=========================================
  Hits           2268     2268           
  Misses            9        9           
Impacted Files Coverage Δ
packages/framework/src/Contracts/AbstractPage.php 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@caendesilva caendesilva changed the title Improve navigation menu Add navigation menu dropdown component Sep 1, 2022
@caendesilva caendesilva marked this pull request as ready for review September 1, 2022 13:09
…on-to-group-together-items-for-dropdowns' of github.com:hydephp/develop into 76-feature-request-improve-navigation-menu-and-add-option-to-group-together-items-for-dropdowns
@caendesilva caendesilva merged commit 238ddfb into master Sep 1, 2022
@caendesilva caendesilva deleted the 76-feature-request-improve-navigation-menu-and-add-option-to-group-together-items-for-dropdowns branch September 1, 2022 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Improve navigation menu and add option to group together items for dropdowns
2 participants