2021-08-14 03:17:43 +08:00
|
|
|
defmodule LivebookWeb.PageHelpers do
|
|
|
|
use Phoenix.Component
|
|
|
|
|
2022-03-18 06:33:18 +08:00
|
|
|
import LivebookWeb.LiveHelpers
|
2021-08-14 03:17:43 +08:00
|
|
|
|
|
|
|
alias LivebookWeb.Router.Helpers, as: Routes
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
Renders page title.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
2021-09-19 05:51:16 +08:00
|
|
|
<.title text="Explore" socket={@socket} />
|
2021-08-14 03:17:43 +08:00
|
|
|
"""
|
|
|
|
def title(assigns) do
|
|
|
|
~H"""
|
|
|
|
<div class="relative">
|
2022-02-10 22:36:59 +08:00
|
|
|
<%= live_redirect to: Routes.home_path(@socket, :page),
|
2021-08-14 03:17:43 +08:00
|
|
|
class: "hidden md:block absolute top-[50%] left-[-12px] transform -translate-y-1/2 -translate-x-full" do %>
|
|
|
|
<.remix_icon icon="arrow-left-line" class="text-2xl align-middle" />
|
|
|
|
<% end %>
|
|
|
|
<h1 class="text-3xl text-gray-800 font-semibold">
|
|
|
|
<%= @text %>
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
end
|
|
|
|
end
|