Skip to content

Commit

Permalink
display favicon when mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Jun 3, 2024
1 parent d653521 commit a9b1ac9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions decidim-core/app/helpers/decidim/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,9 @@ def cell(name, model, options = {}, &)
def prevent_timeout_seconds
0
end

def user_initials(name)
name.split.map(&:first).join.upcase
end
end
end
10 changes: 9 additions & 1 deletion decidim-core/app/packs/stylesheets/decidim/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ header {
}

&__dropdown-before {
@apply before:block before:absolute before:-top-8 before:right-12 before:content-[""] before:bg-secondary before:w-24 before:h-8 before:-mt-8;
@apply before:block before:absolute before:-top-10 before:right-12 before:content-[""] before:bg-white before:w-24 before:h-12 before:-mt-8;
}

&__account {
Expand All @@ -154,6 +154,10 @@ header {
.main-bar__avatar {
@apply w-12 h-12;
}

.account-container {
@apply before:block before:absolute before:top-16 before:right-14 before:content-[""] before:bg-white before:w-2 before:h-12 before:-mt-8;
}
}

&__item {
Expand Down Expand Up @@ -209,6 +213,10 @@ header {
}
}

&__avatar-name {
@apply w-6 h-6 flex items-center justify-center bg-secondary text-white rounded-full text-xs font-bold;
}

/* overwrite default dropdown styles */
[id*="dropdown-menu"] {
@apply py-0 mx-0 w-full;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<div id="dropdown-menu-account-mobile" class="main-bar__links-mobile__account" aria-hidden="true">
<div class="main-bar">
<div class="main-bar__logo">
<%= render partial: "layouts/decidim/logo", locals: { organization: current_organization } %>
<div class="main-bar__logo-desktop">
<%= render partial: "layouts/decidim/logo", locals: { organization: current_organization } %>
</div>
<div class="lg:hidden">
<%= render partial: "layouts/decidim/logo_mobile", locals: { organization: current_organization } %>
</div>
</div>

<div>
Expand All @@ -11,7 +16,7 @@
</div>
</div>

<div class="p-4 container">
<div class="account-container p-4 container">
<% if current_user.avatar.attached? %>
<div class="main-bar__avatar">
<%= image_tag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
) %>
</span>
<% else %>
<%= icon "user-smile-line" %>
<div class="main-bar__avatar-name">
<%= user_initials(current_user.name) %>
</div>
<% end %>

</button>
Expand Down

0 comments on commit a9b1ac9

Please sign in to comment.