diff --git a/app/assets/stylesheets/buttons.css b/app/assets/stylesheets/buttons.css index 5a5c910d1..e69295f3e 100644 --- a/app/assets/stylesheets/buttons.css +++ b/app/assets/stylesheets/buttons.css @@ -199,6 +199,23 @@ } } + .btn--back { + @media (max-width: 639px) { + padding: 0.5em; + + kbd, + .btn--back__label { + display: none; + } + } + + @media (min-width: 640px) { + .icon--arrow-left { + display: none; + } + } + } + /* Button groups /* ------------------------------------------------------------------------ */ diff --git a/app/assets/stylesheets/events.css b/app/assets/stylesheets/events.css index 06eaaa15c..20fb53217 100644 --- a/app/assets/stylesheets/events.css +++ b/app/assets/stylesheets/events.css @@ -3,6 +3,8 @@ /* ------------------------------------------------------------------------ */ .header--events { + --header-button-count: 1; + @media (min-width: 640px) { --header-actions-width: 7.25rem !important; } diff --git a/app/assets/stylesheets/header.css b/app/assets/stylesheets/header.css index be5448991..46a345d3c 100644 --- a/app/assets/stylesheets/header.css +++ b/app/assets/stylesheets/header.css @@ -91,4 +91,21 @@ margin-inline-end: 0.8ch; } } + + /* Optional class to stack header actions on small screens + /* ------------------------------------------------------------------------ */ + + /* .header--mobile-actions-stack { + @media (max-width: 639px) { + grid-template-columns: 1fr 1fr; + grid-template-areas: + "menu menu" + "actions-start actions-end" + "title title"; + + .header__title { + margin-block-start: 0.25rem; + } + } + } */ } diff --git a/app/helpers/boards_helper.rb b/app/helpers/boards_helper.rb index 3fde0d2ad..2de839990 100644 --- a/app/helpers/boards_helper.rb +++ b/app/helpers/boards_helper.rb @@ -1,8 +1,8 @@ module BoardsHelper def link_back_to_board(board) - link_to board, class: "btn borderless txt-medium", + link_to board, class: "btn--back btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click click->turbo-navigation#backIfSamePath" } do - tag.span(tag.strong("Back to #{board.name}", class: "overflow-ellipsis") + tag.kbd("←", class: "txt-x-small margin-inline-start hide-on-touch"), class: "flex align-center").html_safe + icon_tag("arrow-left") + tag.strong("Back to #{board.name}", class: "btn--back__label overflow-ellipsis") + tag.kbd("←", class: "txt-x-small hide-on-touch").html_safe end end diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 8f0e659e7..95545d536 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -1,5 +1,5 @@ <% @page_title = "Home" %> -<% @header_class = "header--events" %> +<% @header_class = "header--events header--mobile-actions-stack" %> <%= render "cards/broadcasts", filter: @filter %> @@ -14,6 +14,8 @@ <%= render "events/index/filter", user_filtering: @user_filtering %> <% end %> + + <%= render "events/index/add_board_button", user_filtering: @user_filtering %> <% end %> <%= tag.div id: "activity", class: "events", data: { controller: "pagination", pagination_paginate_on_intersection_value: true } do %> diff --git a/app/views/events/index/_add_board_button.html.erb b/app/views/events/index/_add_board_button.html.erb new file mode 100644 index 000000000..3af54a792 --- /dev/null +++ b/app/views/events/index/_add_board_button.html.erb @@ -0,0 +1,9 @@ +