From 1d30a141139197071280ab4de54be58a51878b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Rodr=C3=ADguez=20Chatruc?= <49622509+jrchatruc@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:52:57 -0300 Subject: [PATCH] Fix links that were using the old format with `/mainnet` (#225) --- .../live/contract_live.ex | 6 --- .../live/pages/home/index.ex | 38 +++++++++++-------- lib/starknet_explorer_web/live/search.ex | 10 ++++- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/lib/starknet_explorer_web/live/contract_live.ex b/lib/starknet_explorer_web/live/contract_live.ex index 4c83df40..fd051600 100644 --- a/lib/starknet_explorer_web/live/contract_live.ex +++ b/lib/starknet_explorer_web/live/contract_live.ex @@ -161,12 +161,6 @@ defmodule StarknetExplorerWeb.ContractDetailLive do
Deployed At Transaction Hash
- <%= live_redirect( - "0x065150851e490476ca3cc69dbd70911a03b305951335b3aeb77d2eb0ce757df3" - |> Utils.shorten_block_hash(), - to: - ~p"/#{@network}/transactions/0x065150851e490476ca3cc69dbd70911a03b305951335b3aeb77d2eb0ce757df3" - ) %>
- +
@@ -65,7 +65,7 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
- +
@@ -80,7 +80,7 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
- +
@@ -95,7 +95,7 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
- +
@@ -138,19 +138,23 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
Block Hash
- <%= live_redirect(Utils.shorten_block_hash(block.hash), - to: ~p"/#{assigns.network}/blocks/#{block.hash}", - class: "text-hover-blue", - title: block.hash - ) %> + + <%= Utils.shorten_block_hash(block.hash) %> +
Transaction Hash
- <%= live_redirect(Utils.shorten_block_hash(transaction.hash), - to: ~p"/#{assigns.network}/transactions/#{transaction.hash}", - class: "text-hover-blue" - ) %> + + <%= Utils.shorten_block_hash(transaction.hash) %> +
fn -> - push_navigate(socket, to: ~p"/#{socket.assigns.network}/transactions/#{query}") + push_navigate(socket, + to: Utils.network_path(socket.assigns.network, "transactions/#{query}") + ) end {:block, _block} -> - fn -> push_navigate(socket, to: ~p"/#{socket.assigns.network}/blocks/#{query}") end + fn -> + push_navigate(socket, + to: Utils.network_path(socket.assigns.network, "blocks/#{query}") + ) + end :noquery -> fn ->