Changes related to LiveView Update
This commit is contained in:
parent
b710eeec99
commit
518a6b2a26
|
@ -32,5 +32,6 @@ let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("
|
|||
let liveSocket = new LiveSocket("/live", Socket, { hooks: Hooks, params: { _csrf_token: csrfToken } })
|
||||
liveSocket.connect()
|
||||
window.liveSocket = liveSocket
|
||||
liveSocket.enableDebug()
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ defmodule ZcashExplorerWeb do
|
|||
|
||||
def view do
|
||||
quote do
|
||||
import Phoenix.LiveView.Helpers
|
||||
|
||||
use Phoenix.View,
|
||||
root: "lib/zcash_explorer_web/templates",
|
||||
|
@ -39,6 +38,8 @@ defmodule ZcashExplorerWeb do
|
|||
import Phoenix.Controller,
|
||||
only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1]
|
||||
|
||||
import Phoenix.LiveView.Helpers
|
||||
|
||||
# Include shared imports and aliases for views
|
||||
unquote(view_helpers())
|
||||
end
|
||||
|
@ -61,6 +62,23 @@ defmodule ZcashExplorerWeb do
|
|||
end
|
||||
end
|
||||
|
||||
def live_view do
|
||||
quote do
|
||||
use Phoenix.LiveView,
|
||||
layout: {ZcashExplorerWeb.LayoutView, "live.html"}
|
||||
|
||||
unquote(view_helpers())
|
||||
end
|
||||
end
|
||||
|
||||
def live_component do
|
||||
quote do
|
||||
use Phoenix.LiveComponent
|
||||
|
||||
unquote(view_helpers())
|
||||
end
|
||||
end
|
||||
|
||||
defp view_helpers do
|
||||
quote do
|
||||
# Use all HTML functionality (forms, tags, etc)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.BlockCountLive do
|
||||
use Phoenix.LiveView
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
defmodule ZcashExplorerWeb.BlockChainInfoLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.BlockChainSizeLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.DifficultyLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.MempoolInfoLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.NetworkSolpsLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.NodesLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.PriceLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.RawMempoolLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.RecentBlocksLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.RecentTransactionsLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule ZcashExplorerWeb.VkLive do
|
||||
use Phoenix.LiveView
|
||||
|
||||
use ZcashExplorerWeb, :live_view
|
||||
import Phoenix.LiveView.Helpers
|
||||
@impl true
|
||||
def render(%{message: %{"txs" => []}} = assigns) do
|
||||
~L"""
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="flex items-center px-2 lg:px-0 xl:w-64">
|
||||
<a href="/">
|
||||
<div class="flex-shrink-0">
|
||||
<img class="h-8 w-auto" src="<%= Routes.static_path(@conn, "/images/zcash-icon-white.svg") %>" alt="Block Explorer">
|
||||
<img class="h-8 w-auto" src={"#{ Routes.static_path(@conn, "/images/zcash-icon-white.svg")}"} alt="Block Explorer">
|
||||
</div>
|
||||
</a>
|
||||
<a href="/">
|
||||
|
@ -78,8 +78,6 @@ Heroicon name: outline/x" x-state:on="Menu open" x-state:off="Menu closed" class
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div x-description="Mobile menu, show/hide based on menu state." class="lg:hidden" id="mobile-menu" x-show="open">
|
||||
<div class="px-2 pt-2 pb-3">
|
||||
|
|
@ -0,0 +1 @@
|
|||
<%= @inner_content %>
|
|
@ -5,9 +5,9 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<%= live_title_tag assigns[:page_title] || " " %>
|
||||
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
|
||||
<link rel="stylesheet" href={"#{Routes.static_path(@conn, "/css/app.css")}"}/>
|
||||
<%= csrf_meta_tag() %>
|
||||
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
|
||||
<script defer type="text/javascript" src={"#{Routes.static_path(@conn, "/js/app.js")}"}></script>
|
||||
</head>
|
||||
<body>
|
||||
<%= @inner_content %>
|
Loading…
Reference in New Issue