-
-
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
-
-
+
+
+
+
+
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+
+
+
-
+
)
diff --git a/packages/wallet/src/components/Sidebar.tsx b/packages/wallet/src/components/Sidebar.tsx
index e98d346cf..96e4c864a 100644
--- a/packages/wallet/src/components/Sidebar.tsx
+++ b/packages/wallet/src/components/Sidebar.tsx
@@ -2,8 +2,8 @@ import { Link } from "react-router-dom"
import { Computer } from "@bitcoin-computer/lib"
import { HiRefresh } from "react-icons/hi"
import { initFlowbite } from "flowbite"
-import { useCallback, useEffect, useState } from "react"
-import { Auth } from "@bitcoin-computer/components"
+import { useCallback, useContext, useEffect, useState } from "react"
+import { Auth, ComputerContext } from "@bitcoin-computer/components"
function Balance({ computer }: { computer: Computer }) {
const [balance, setBalance] = useState(0)
@@ -34,7 +34,7 @@ function Balance({ computer }: { computer: Computer }) {
}
export function SideBar() {
- const [computer] = useState(Auth.getComputer())
+ const computer = useContext(ComputerContext)
return (
<>
diff --git a/packages/wallet/src/components/Transactions.tsx b/packages/wallet/src/components/Transactions.tsx
index 8f2bc4a9a..5e12c2c43 100644
--- a/packages/wallet/src/components/Transactions.tsx
+++ b/packages/wallet/src/components/Transactions.tsx
@@ -1,13 +1,13 @@
import { initFlowbite } from "flowbite"
-import { useCallback, useEffect, useState } from "react"
+import { useCallback, useContext, useEffect, useState } from "react"
import { HiRefresh } from "react-icons/hi"
import TransactionTable from "./TransactionTable"
import { TableTxs } from "../types/common"
-import { Auth } from "@bitcoin-computer/components"
+import { ComputerContext } from "@bitcoin-computer/components"
export default function Transactions() {
- const [computer] = useState(Auth.getComputer())
+ const computer = useContext(ComputerContext)
const [txs, setTxs] = useState
({ sentTxs: [], receivedTxs: [] })
const updateTxs = useCallback(async () => {