mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-12 22:46:17 +08:00
Make notebook_card clickable (#1501)
This commit is contained in:
parent
7bf1904d8b
commit
2dd9e9f8d3
2 changed files with 7 additions and 10 deletions
|
@ -8,25 +8,22 @@ defmodule LivebookWeb.LearnHelpers do
|
||||||
"""
|
"""
|
||||||
def notebook_card(assigns) do
|
def notebook_card(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<div class="flex flex-col">
|
<%= live_redirect to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
|
||||||
<%= live_redirect to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
|
class: "flex flex-col border-2 border-gray-100 hover:border-gray-200 rounded-2xl" do %>
|
||||||
class: "flex items-center justify-center p-6 border-2 border-gray-100 rounded-t-2xl h-[150px]" do %>
|
<div class="flex items-center justify-center p-6 border-b-2 border-gray-100 rounded-t-2xl h-[150px]">
|
||||||
<img
|
<img
|
||||||
src={@notebook_info.details.cover_url}
|
src={@notebook_info.details.cover_url}
|
||||||
class="max-h-full max-w-[75%]"
|
class="max-h-full max-w-[75%]"
|
||||||
alt={"#{@notebook_info.title} logo"}
|
alt={"#{@notebook_info.title} logo"}
|
||||||
/>
|
/>
|
||||||
<% end %>
|
</div>
|
||||||
<div class="px-6 py-4 bg-gray-100 rounded-b-2xl grow">
|
<div class="px-6 py-4 bg-gray-100 rounded-b-2xl grow">
|
||||||
<%= live_redirect(@notebook_info.title,
|
<span class="text-gray-800 font-semibold"><%= @notebook_info.title %></span>
|
||||||
to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
|
|
||||||
class: "text-gray-800 font-semibold cursor-pointer"
|
|
||||||
) %>
|
|
||||||
<p class="mt-2 text-sm text-gray-600">
|
<p class="mt-2 text-sm text-gray-600">
|
||||||
<%= @notebook_info.details.description %>
|
<%= @notebook_info.details.description %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,7 +39,7 @@ defmodule LivebookWeb.LearnLive do
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
id="welcome-to-livebook"
|
id="welcome-to-livebook"
|
||||||
class="p-8 bg-gray-900 rounded-2xl flex flex-col sm:flex-row space-y-8 sm:space-y-0 space-x-0 sm:space-x-8 items-center shadow-xl"
|
class="p-8 bg-gray-900 rounded-2xl flex flex-col sm:flex-row space-y-8 sm:space-y-0 space-x-0 sm:space-x-8 items-center"
|
||||||
>
|
>
|
||||||
<img src={@lead_notebook_info.details.cover_url} width="100" alt="livebook" />
|
<img src={@lead_notebook_info.details.cover_url} width="100" alt="livebook" />
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue