From 93515f8c5a538285a7f3713ab116a691a24e177a Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 3 Jan 2024 17:06:36 +0000 Subject: [PATCH] feat: update breakpoints for responsive layout changes --- app/frontend/styles/_data_box.scss | 20 ++++++++--- app/views/home/_data_box.html.erb | 6 ++-- app/views/home/index.html.erb | 56 ++++++++++++++++-------------- 3 files changed, 49 insertions(+), 33 deletions(-) diff --git a/app/frontend/styles/_data_box.scss b/app/frontend/styles/_data_box.scss index a18c96baf..c90df19a6 100644 --- a/app/frontend/styles/_data_box.scss +++ b/app/frontend/styles/_data_box.scss @@ -2,22 +2,32 @@ @include govuk-font($size: 19); font-weight: bold; white-space: nowrap; - width: 100%; } -@media (min-width: 72.5em) { - .app-data-box-group { + +@media (min-width: 48.0625em) { + .app-data-box-group-one-third { display: flex; justify-content: space-between; column-gap: govuk-spacing(4); + width: 100%; } } -@media (min-width: 72.5em) { +@media (min-width: 66.25em) { .app-data-box-one-third { width: 33.3333333%; float: left; } } -@media (min-width: 72.5em) { +@media (min-width: 54.0625em) { + .app-data-box-group-one-half { + display: flex; + justify-content: space-between; + column-gap: govuk-spacing(4); + width: 100%; + } +} + +@media (min-width: 54.0625em) { .app-data-box-one-half { width: 50%; float: left; diff --git a/app/views/home/_data_box.html.erb b/app/views/home/_data_box.html.erb index d2a26d1b4..38efb5195 100644 --- a/app/views/home/_data_box.html.erb +++ b/app/views/home/_data_box.html.erb @@ -1,5 +1,7 @@ -
-
<%= data_count(@current_user, type) %>
+
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 2259528dc..74ef1617f 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -6,36 +6,40 @@

<%= heading_for_user_role(@current_user) %>

-
- <% if @current_user.support? || (@current_user.data_coordinator? && @current_user.sales_logs.present?)%> -
- <%= render partial: "home/data_box", locals: {type: "lettings"} %> -
-
- <%= render partial: "home/data_box", locals: {type: "sales"} %> -
-
- <%= render partial: "home/data_box", locals: {type: "schemes"} %> -
- <% else %> -
- <%= render partial: "home/data_box", locals: {type: "lettings"} %> -
- <% if @current_user.data_coordinator? %> -
- <%= render partial: "home/data_box", locals: {type: "schemes"} %> -
- <% elsif @current_user.sales_logs.present? %> -
- <%= render partial: "home/data_box", locals: {type: "sales"} %> +
+ <% if @current_user.support? || (@current_user.data_coordinator? && @current_user.sales_logs.present?)%> +
+
+ <%= render partial: "home/data_box", locals: {type: "lettings"} %> +
+
+ <%= render partial: "home/data_box", locals: {type: "sales"} %> +
+
+ <%= render partial: "home/data_box", locals: {type: "schemes"} %> +
<% else %> -
- <%= render partial: "home/data_box", locals: {type: "misc"} %> +
+
+ <%= render partial: "home/data_box", locals: {type: "lettings"} %> +
+ <% if @current_user.data_coordinator? %> +
+ <%= render partial: "home/data_box", locals: {type: "schemes"} %> +
+ <% elsif @current_user.sales_logs.present? %> +
+ <%= render partial: "home/data_box", locals: {type: "sales"} %> +
+ <% else %> +
+ <%= render partial: "home/data_box", locals: {type: "misc"} %> +
+ <% end %>
<% end %> - <% end %> -
+