Skip to content

Commit 2dd9e9f

Browse files
authored
Make notebook_card clickable (#1501)
1 parent 7bf1904 commit 2dd9e9f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

lib/livebook_web/live/learn_helpers.ex

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,22 @@ defmodule LivebookWeb.LearnHelpers do
88
"""
99
def notebook_card(assigns) do
1010
~H"""
11-
<div class="flex flex-col">
12-
<%= live_redirect to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
13-
class: "flex items-center justify-center p-6 border-2 border-gray-100 rounded-t-2xl h-[150px]" do %>
11+
<%= live_redirect to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
12+
class: "flex flex-col border-2 border-gray-100 hover:border-gray-200 rounded-2xl" do %>
13+
<div class="flex items-center justify-center p-6 border-b-2 border-gray-100 rounded-t-2xl h-[150px]">
1414
<img
1515
src={@notebook_info.details.cover_url}
1616
class="max-h-full max-w-[75%]"
1717
alt={"#{@notebook_info.title} logo"}
1818
/>
19-
<% end %>
19+
</div>
2020
<div class="px-6 py-4 bg-gray-100 rounded-b-2xl grow">
21-
<%= live_redirect(@notebook_info.title,
22-
to: Routes.learn_path(@socket, :notebook, @notebook_info.slug),
23-
class: "text-gray-800 font-semibold cursor-pointer"
24-
) %>
21+
<span class="text-gray-800 font-semibold"><%= @notebook_info.title %></span>
2522
<p class="mt-2 text-sm text-gray-600">
2623
<%= @notebook_info.details.description %>
2724
</p>
2825
</div>
29-
</div>
26+
<% end %>
3027
"""
3128
end
3229
end

lib/livebook_web/live/learn_live.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ defmodule LivebookWeb.LearnLive do
3939
</div>
4040
<div
4141
id="welcome-to-livebook"
42-
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"
42+
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"
4343
>
4444
<img src={@lead_notebook_info.details.cover_url} width="100" alt="livebook" />
4545
<div>

0 commit comments

Comments
 (0)