From 18735928c97415f98ddbaa18852ca22aaf2c27aa Mon Sep 17 00:00:00 2001 From: Aayush Kumar Sahu Date: Sun, 15 Jan 2023 17:13:12 +0530 Subject: [PATCH] Fix import button disappear in small screens (#1643) --- lib/livebook_web/live/home_live.ex | 13 +++++++++---- lib/livebook_web/live/layout_helpers.ex | 12 +++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/livebook_web/live/home_live.ex b/lib/livebook_web/live/home_live.ex index 574f3a04a..facb439b0 100644 --- a/lib/livebook_web/live/home_live.ex +++ b/lib/livebook_web/live/home_live.ex @@ -43,10 +43,15 @@ defmodule LivebookWeb.HomeLive do saved_hubs={@saved_hubs} > <:topbar_action> - - <.remix_icon icon="add-line" /> - New notebook - +
+ <%= live_patch("Import", + to: Routes.home_path(@socket, :import, "url"), + class: "button-base button-outlined-gray whitespace-nowrap" + ) %> + +
<.update_notification version={@new_version} instructions_url={@update_instructions_url} /> <.memory_notification memory={@memory} app_service_url={@app_service_url} /> diff --git a/lib/livebook_web/live/layout_helpers.ex b/lib/livebook_web/live/layout_helpers.ex index e35926943..a13b30013 100644 --- a/lib/livebook_web/live/layout_helpers.ex +++ b/lib/livebook_web/live/layout_helpers.ex @@ -40,12 +40,14 @@ defmodule LivebookWeb.LayoutHelpers do -
+
<%= if @topbar_action == [] do %> - <%= live_redirect to: Routes.home_path(@socket, :page), class: "flex items-center", aria: [label: "go to home"] do %> - <.remix_icon icon="home-6-line" /> - Home - <% end %> +
+ <%= live_redirect to: Routes.home_path(@socket, :page), class: "flex items-center", aria: [label: "go to home"] do %> + <.remix_icon icon="home-6-line" /> + Home + <% end %> +
<% else %> <%= render_slot(@topbar_action) %> <% end %>