From 4148a3d691e0eac3ed9f563eaac0047ab69b2c99 Mon Sep 17 00:00:00 2001 From: endoooo Date: Tue, 19 Dec 2023 14:17:40 -0300 Subject: [PATCH] chore: minor visual adjustments - added support to `theme` and `size` attrs in `<.cover>` component - adjusted not nil entry styles in strand assessment tab --- .../components/core_components.ex | 22 +++++++++++++++++-- .../activity/id/activity_live.html.heex | 6 ++++- .../pages/strands/id/assessment_component.ex | 9 +++++++- .../pages/strands/id/strand_live.html.heex | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/lib/lanttern_web/components/core_components.ex b/lib/lanttern_web/components/core_components.ex index 5ebc064f..eb9b31d1 100644 --- a/lib/lanttern_web/components/core_components.ex +++ b/lib/lanttern_web/components/core_components.ex @@ -339,13 +339,25 @@ defmodule LantternWeb.CoreComponents do Renders a page cover. """ attr :rest, :global + attr :size, :string, default: "lg", doc: "sm | lg" + attr :theme, :string, default: "primary" slot :inner_block, required: true slot :top, required: true def cover(assigns) do ~H""" -
-
+
+
<%= render_slot(@top) %> @@ -358,6 +370,12 @@ defmodule LantternWeb.CoreComponents do """ end + defp cover_overlay("violet"), + do: "from-ltrn-mesh-violet/0 to-ltrn-mesh-violet" + + defp cover_overlay(_primary), + do: "from-ltrn-mesh-primary/0 to-ltrn-mesh-primary" + @doc ~S""" Renders a table with generic styling. diff --git a/lib/lanttern_web/live/pages/strands/activity/id/activity_live.html.heex b/lib/lanttern_web/live/pages/strands/activity/id/activity_live.html.heex index d40c2fb4..a2dd8dba 100644 --- a/lib/lanttern_web/live/pages/strands/activity/id/activity_live.html.heex +++ b/lib/lanttern_web/live/pages/strands/activity/id/activity_live.html.heex @@ -1,4 +1,8 @@ -<.cover style="background-image: url(https://images.unsplash.com/photo-1529476488885-3159d45ab78b?q=80&w=1280&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)"> +<.cover + size="sm" + theme="violet" + style="background-image: url(https://images.unsplash.com/photo-1529476488885-3159d45ab78b?q=80&w=1280&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)" +> <:top>
<.breadcrumbs class="mt-2" item_class="text-white"> diff --git a/lib/lanttern_web/live/pages/strands/id/assessment_component.ex b/lib/lanttern_web/live/pages/strands/id/assessment_component.ex index b55b033f..8d2dcc7a 100644 --- a/lib/lanttern_web/live/pages/strands/id/assessment_component.ex +++ b/lib/lanttern_web/live/pages/strands/id/assessment_component.ex @@ -166,7 +166,14 @@ defmodule LantternWeb.StrandLive.AssessmentComponent do /> <%= for entry <- @entries do %>
<%= get_entry_value(entry, @scale_ov_map) %> diff --git a/lib/lanttern_web/live/pages/strands/id/strand_live.html.heex b/lib/lanttern_web/live/pages/strands/id/strand_live.html.heex index ec3aa4b9..b7b62e00 100644 --- a/lib/lanttern_web/live/pages/strands/id/strand_live.html.heex +++ b/lib/lanttern_web/live/pages/strands/id/strand_live.html.heex @@ -14,7 +14,7 @@ <.badge :for={year <- @strand.years} theme="dark"><%= year.name %>
-
+
<.nav_tabs id="strand-nav-tabs"> <:tab