Skip to content

Commit 25d4c38

Browse files
committed
fix: standardize home layout menu UX
1 parent 7f8b62f commit 25d4c38

File tree

4 files changed

+33
-65
lines changed

4 files changed

+33
-65
lines changed

decidim-core/app/cells/decidim/participatory_space_dropdown_metadata/show.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<%= render :metadata %>
44
<%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", model, hide_participatory_space: true %>
55
</div>
6-
<ul class="menu-bar__secondary-dropdown__menu">
6+
<ul class="menu-bar__dropdown-menu">
77
<%= render :links %>
88
</ul>
99
</div>

decidim-core/app/helpers/decidim/menu_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ def breadcrumb_root_menu
3939
@breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new(
4040
:menu,
4141
self,
42-
container_options: { class: "menu-bar__main-dropdown__menu" }
42+
container_options: { class: "menu-bar__dropdown-menu" }
4343
)
4444
end
4545

4646
def mobile_breadcrumb_root_menu
4747
@mobile_breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new(
4848
:mobile_menu,
4949
self,
50-
container_options: { class: "menu-bar__main-dropdown__menu" }
50+
container_options: { class: "menu-bar__dropdown-menu" }
5151
)
5252
end
5353

decidim-core/app/packs/stylesheets/decidim/_header.scss

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -371,15 +371,34 @@ header {
371371
@apply absolute top-full left-0 bg-white rounded w-full bg-gray-5;
372372
}
373373

374+
&__dropdown-menu {
375+
@apply w-full md:w-1/4 bg-primary px-4 md:px-8 pt-0 pb-3 md:py-3 divide-y divide-gray-3 text-white;
376+
377+
> * {
378+
@apply py-3 md:py-3.5;
379+
}
380+
381+
a {
382+
@apply flex items-center justify-start gap-1 font-semibold text-lg text-white;
383+
384+
span {
385+
@apply min-w-0 truncate;
386+
}
387+
388+
svg {
389+
@apply flex-none fill-current;
390+
}
391+
}
392+
}
393+
374394
&__main-dropdown {
375-
@apply bg-white divide-y divide-gray-3 rounded-b shadow-lg text-black w-full lg:w-[1280px] h-screen md:h-auto;
395+
@apply bg-white flex flex-row rounded-b shadow-lg text-black w-full lg:w-[1280px] h-screen md:h-auto;
376396

377-
&__bottom,
378-
&__top {
379-
@apply flex flex-col md:flex-row justify-between p-4 md:p-8 gap-x-8;
397+
&__left {
398+
@apply flex flex-col justify-between p-4 md:p-8 space-y-5 hidden md:block md:w-3/4;
380399

381-
&-right {
382-
@apply hidden md:block md:w-1/2;
400+
&-top {
401+
@apply border-b-4 border-gray-3 pb-3;
383402
}
384403
}
385404

@@ -394,31 +413,6 @@ header {
394413
&__subtitle {
395414
@apply hidden text-md md:flex md:text-lg text-gray-2 mt-5;
396415
}
397-
398-
&__menu {
399-
@apply w-full md:w-1/2 mt-0 grid md:grid-cols-2 gap-x-6 text-secondary;
400-
401-
> * {
402-
@apply py-3 md:py-3.5 border-b last:border-0 border-gray-3;
403-
404-
/* since the grid has 2 columns, remove the border for these last 2 columns */
405-
&:nth-last-child(-n + 2) {
406-
@apply md:border-0;
407-
}
408-
}
409-
410-
a {
411-
@apply flex items-center justify-start gap-1 font-semibold text-lg text-secondary;
412-
413-
span {
414-
@apply min-w-0 truncate;
415-
}
416-
417-
svg {
418-
@apply flex-none fill-current;
419-
}
420-
}
421-
}
422416
}
423417

424418
&__secondary-dropdown {
@@ -432,26 +426,6 @@ header {
432426
@apply h4 md:h3;
433427
}
434428

435-
&__menu {
436-
@apply w-full md:w-1/4 bg-primary px-4 md:px-8 pt-0 pb-3 md:py-3 divide-y divide-gray-3 text-white;
437-
438-
> * {
439-
@apply py-3 md:py-3.5;
440-
}
441-
442-
a {
443-
@apply flex items-center justify-start gap-1 font-semibold text-lg text-white;
444-
445-
span {
446-
@apply min-w-0 truncate;
447-
}
448-
449-
svg {
450-
@apply flex-none fill-current;
451-
}
452-
}
453-
}
454-
455429
&__metadata {
456430
@apply flex items-center text-sm space-x-6 py-8;
457431

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
<div id="<%= id %>" class="menu-bar__main-dropdown">
2-
<div class="menu-bar__main-dropdown__top">
3-
<div class="menu-bar__main-dropdown__top-left">
2+
<div class="menu-bar__main-dropdown__left">
3+
<div class="menu-bar__main-dropdown__left-top">
44
<%= render partial: "layouts/decidim/header/menu_breadcrumb_main_dropdown_top_left" %>
55
</div>
6-
<%= breadcrumb_root_menu.render %>
7-
</div>
8-
<div class="menu-bar__main-dropdown__bottom">
9-
<div class="menu-bar__main-dropdown__bottom-left">
10-
<%= cell("decidim/highlighted_participatory_process", menu_highlighted_participatory_process) %>
11-
</div>
12-
<div class="menu-bar__main-dropdown__bottom-right">
13-
<%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", current_organization %>
14-
</div>
6+
<%= cell("decidim/highlighted_participatory_process", menu_highlighted_participatory_process) %>
7+
<%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", current_organization %>
158
</div>
9+
<%= breadcrumb_root_menu.render %>
1610
</div>

0 commit comments

Comments
 (0)