Extract title into effect
This commit is contained in:
parent
66d6ccae10
commit
32a93e211f
|
@ -1,4 +1,4 @@
|
|||
import React, { useContext } from "react";
|
||||
import React, { useContext, useEffect } from "react";
|
||||
import { useParams, Route, Routes } from "react-router-dom";
|
||||
import { Tab } from "@headlessui/react";
|
||||
import StandardFrame from "./StandardFrame";
|
||||
|
@ -25,6 +25,12 @@ const Transaction: React.FC = () => {
|
|||
const txData = useTxData(provider, txHash);
|
||||
const selectionCtx = useSelection();
|
||||
|
||||
useEffect(() => {
|
||||
if (txData) {
|
||||
document.title = `Transaction ${txData.transactionHash} | Otterscan`;
|
||||
}
|
||||
}, [txData]);
|
||||
|
||||
return (
|
||||
<SelectedTransactionContext.Provider value={txData}>
|
||||
<BlockNumberContext.Provider value={txData?.confirmedData?.blockNumber}>
|
||||
|
|
|
@ -207,8 +207,6 @@ export const useTxData = (
|
|||
return;
|
||||
}
|
||||
|
||||
document.title = `Transaction ${_response.hash} | Otterscan`;
|
||||
|
||||
setTxData({
|
||||
transactionHash: _response.hash,
|
||||
from: _response.from,
|
||||
|
|
Loading…
Reference in New Issue