Make notebook_card clickable (#1501)

This commit is contained in:
Kevin 2022-10-25 15:33:15 +02:00 committed by GitHub
parent 7bf1904d8b
commit 2dd9e9f8d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View file

@ -8,25 +8,22 @@ defmodule LivebookWeb.LearnHelpers do
"""
def notebook_card(assigns) do
~H"""
<div class="flex flex-col">
<%= live_redirect to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
class: "flex items-center justify-center p-6 border-2 border-gray-100 rounded-t-2xl h-[150px]" do %>
<%= 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 %>
<div class="flex items-center justify-center p-6 border-b-2 border-gray-100 rounded-t-2xl h-[150px]">
<img
src={@notebook_info.details.cover_url}
class="max-h-full max-w-[75%]"
alt={"#{@notebook_info.title} logo"}
/>
<% end %>
</div>
<div class="px-6 py-4 bg-gray-100 rounded-b-2xl grow">
<%= live_redirect(@notebook_info.title,
to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
class: "text-gray-800 font-semibold cursor-pointer"
) %>
<span class="text-gray-800 font-semibold"><%= @notebook_info.title %></span>
<p class="mt-2 text-sm text-gray-600">
<%= @notebook_info.details.description %>
</p>
</div>
</div>
<% end %>
"""
end
end

View file

@ -39,7 +39,7 @@ defmodule LivebookWeb.LearnLive do
</div>
<div
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" />
<div>