mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-05 19:25:28 +08:00
Fix import button disappear in small screens (#1643)
This commit is contained in:
parent
81ab8082ec
commit
18735928c9
2 changed files with 16 additions and 9 deletions
|
@ -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} />
|
||||
|
|
|
@ -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 %>
|
||||
|
|
Loading…
Add table
Reference in a new issue