Fix import button disappear in small screens (#1643)

This commit is contained in:
Aayush Kumar Sahu 2023-01-15 17:13:12 +05:30 committed by GitHub
parent 81ab8082ec
commit 18735928c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 9 deletions

View file

@ -43,10 +43,15 @@ defmodule LivebookWeb.HomeLive do
saved_hubs={@saved_hubs}
>
<:topbar_action>
<a aria-label="new-notebook" class="flex items-center cursor-pointer" phx-click="new">
<.remix_icon icon="add-line" />
<span class="pl-2">New notebook</span>
</a>
<div class="flex space-x-2">
<%= live_patch("Import",
to: Routes.home_path(@socket, :import, "url"),
class: "button-base button-outlined-gray whitespace-nowrap"
) %>
<button class="button-base button-blue" phx-click="new">
New notebook
</button>
</div>
</:topbar_action>
<.update_notification version={@new_version} instructions_url={@update_instructions_url} />
<.memory_notification memory={@memory} app_service_url={@app_service_url} />

View file

@ -40,12 +40,14 @@ defmodule LivebookWeb.LayoutHelpers do
</button>
</div>
<div class="text-gray-400 hover:text-gray-600 focus:text-gray-600">
<div>
<%= 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" />
<span class="pl-2">Home</span>
<% end %>
<div class="text-gray-400 hover:text-gray-600 focus:text-gray-600">
<%= live_redirect to: Routes.home_path(@socket, :page), class: "flex items-center", aria: [label: "go to home"] do %>
<.remix_icon icon="home-6-line" />
<span class="pl-2">Home</span>
<% end %>
</div>
<% else %>
<%= render_slot(@topbar_action) %>
<% end %>