Skip to content

Commit

Permalink
🌸 Eliminate the top navigation
Browse files Browse the repository at this point in the history
- #832
- #621

The top navigation is a bit excessive. This brings the UI to a much
cleaner place; with breadcrumbs and sign in / out only  on the bottom
of the page.
  • Loading branch information
zspencer committed Sep 30, 2023
1 parent 9b32bfc commit 77bb5fe
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 45 deletions.
14 changes: 0 additions & 14 deletions app/assets/stylesheets/components/header.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
@layer components {
body > header {
@apply flex justify-between px-2 py-2 bg-primary-900 text-white place-items-end;

.profile-menu {
@apply flex flex-row relative;
:first-child {
@apply pr-0;
}
> * {
@apply px-2;
}
}
}

.flash-message {
@apply px-4 py-4;

Expand Down
15 changes: 0 additions & 15 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
<header>
<%= render partial: "breadcrumbs" %>

<nav aria-label="Menu" class="profile-menu" data-person-email="<%= current_person.email %>">
<%- if current_person.authenticated? %>
<%- if current_membership.present? %>
<%= link_to "Your Account", [current_space, current_membership], title: current_membership.member.email %>
<%- end %>
<%= link_to "Sign out", [current_space, :authenticated_session].compact, data: { turbo: true, turbo_method: :delete }, class: 'sign-out' %>
<%- else %>
<%= link_to "Sign in", [:new, current_space, :authenticated_session].compact, class: "sign-in" %>
<%- end %>
</nav>
</header>

<%= render "flash_messages" , flash: flash %>
37 changes: 23 additions & 14 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,32 @@
<%- if current_room && policy(current_room).edit? %>
<%= link_to t('icons.edit'), [:edit, current_space, current_room], class: 'no-underline', aria: { label: "Configure Section"} %>
<%- end %>
<%= render Neighborhood::LinkComponent.new %>
</div>
<div>
💾&nbsp;
<%= link_to "Contribute", "https://github.com/zinc-collective/convene" %>
💚&nbsp;
<%= link_to "Sponsor", "https://opencollective.com/zinc-community" %>

</div>

<%- if current_space&.agreements&.present? %>
<div class="text-xs mt-2 w-full flex flex-wrap justify-center">
<%- current_space.agreements.each do |agreement| %>
<%- next unless agreement.persisted? %>
<%= link_to(agreement.name, agreement.location, class: "px-4 py-2") %>
<nav class="text-sm w-full flex flex-wrap justify-center" aria-label="Profile Menu" data-person-email="<%= current_person.email %>">
<%- if current_person.authenticated? %>
<%- if current_membership.present? %>
<%= link_to "Your Account", [current_space, current_membership], title: current_membership.member.email, class: "px-4 py-1" %>
<%- end %>
</div>
<%- end %>
<%= link_to "Sign out", [current_space, :authenticated_session].compact, data: { turbo: true, turbo_method: :delete }, class: "sign-out px-4 py-1" %>
<%- else %>
<%= link_to "Sign in", [:new, current_space, :authenticated_session].compact, class: "px-4 py-1" %>
<%- end %>
</nav>

<div class="text-xs w-full flex flex-wrap justify-center mt-1">
<%= link_to "💾 Contribute", "https://github.com/zinccollective/convene", class: "px-2 py-1" %>
<%= link_to "💚 Sponsor", "https://opencollective.com/zinccommunity", class: "px-2 py-1" %>

<%- current_space&.agreements&.each do |agreement| %>
<%- next unless agreement.persisted? %>
<%= link_to(agreement.name, agreement.location, class: "px-2 py-1") %>
<%- end %>
</div>
<div class="mt-1 text-xs">
<%= render Neighborhood::LinkComponent.new %>
</div>
</footer>
</body>
</html>
5 changes: 4 additions & 1 deletion features/harness/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class Page {
* @returns {PersonNavigationComponent}
*/
personNavigation() {
return this.component(".profile-menu", PersonNavigationComponent);
return this.component(
"*[aria-label='Profile Menu']",
PersonNavigationComponent,
);
}
/**
* Goes directly to the page, as defined in the path method.
Expand Down
2 changes: 1 addition & 1 deletion features/lib/Actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Actor {
* @returns {Promise<boolean>}
*/
isSignedIn(driver) {
return new PersonNavigationComponent(driver, ".profile-menu")
return new PersonNavigationComponent(driver, "*[aria-label='Profile Menu']")
.signedInEmail()
.then((email) => this.email == email);
}
Expand Down

0 comments on commit 77bb5fe

Please sign in to comment.