-
Notifications
You must be signed in to change notification settings - Fork 3
/
layout.ex
33 lines (30 loc) · 848 Bytes
/
layout.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
defmodule LiveviewPlayground.Layout do
use LiveviewPlaygroundWeb, :live_view
def render("live.html", assigns) do
assigns =
assign_new(assigns, :scripts, fn ->
Application.fetch_env!(:liveview_playground, :scripts)
end)
~H"""
<script :for={script <- @scripts} src={script}>
</script>
<script src="https://cdn.jsdelivr.net/npm/phoenix@1.7.0-rc.2/priv/static/phoenix.min.js">
</script>
<script
src="https://cdn.jsdelivr.net/npm/phoenix_live_view@0.18.2/priv/static/phoenix_live_view.min.js"
>
</script>
<script>
let liveSocket = new window.LiveView.LiveSocket("/live", window.Phoenix.Socket)
liveSocket.connect()
</script>
<style>
* { font-size: 1.1em; }
</style>
<%= @inner_content %>
"""
end
def render(assigns) do
~H""
end
end