-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
406 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
defmodule CanaryWeb.ExampleLive.Example do | ||
use CanaryWeb, :live_component | ||
|
||
@impl true | ||
def render(assigns) do | ||
~H""" | ||
<div class="border border-gray-200 py-4 px-6 rounded-md"> | ||
<h2><%= @example.name %></h2> | ||
<p :if={@example[:description]} class="italic mb-4"><%= @example.description %></p> | ||
<div class="flex flex-col gap-0 mt-2"> | ||
<div class="text-md mb-2"> | ||
Click below to try it ↓ | ||
</div> | ||
<%= raw(@example.code) %> | ||
</div> | ||
<div class="flex flex-col gap-0 mt-4 text-wrap"> | ||
<p>Actual code to render above ↓</p> | ||
<code id={@id} phx-hook="Highlight"><%= @example.code %></code> | ||
</div> | ||
</div> | ||
""" | ||
end | ||
|
||
@impl true | ||
def update(assigns, socket) do | ||
{:ok, assign(socket, assigns)} | ||
end | ||
end |
Oops, something went wrong.