Add transaction card component and provider (#5)
This commit is contained in:
committed by
Michael Vines
parent
de1df895a0
commit
6006c30ace
28
explorer/src/components/NetworkStatusButton.tsx
Normal file
28
explorer/src/components/NetworkStatusButton.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from "react";
|
||||
import { useNetwork, NetworkStatus } from "../providers/network";
|
||||
|
||||
function NetworkStatusButton() {
|
||||
const { status, url } = useNetwork();
|
||||
|
||||
switch (status) {
|
||||
case NetworkStatus.Connected:
|
||||
return <span className="btn btn-white lift">{url}</span>;
|
||||
|
||||
case NetworkStatus.Connecting:
|
||||
return (
|
||||
<span className="btn btn-warning lift">
|
||||
{"Connecting "}
|
||||
<span
|
||||
className="spinner-grow spinner-grow-sm text-dark"
|
||||
role="status"
|
||||
aria-hidden="true"
|
||||
></span>
|
||||
</span>
|
||||
);
|
||||
|
||||
case NetworkStatus.Failure:
|
||||
return <span className="btn btn-danger lift">Disconnected</span>;
|
||||
}
|
||||
}
|
||||
|
||||
export default NetworkStatusButton;
|
Reference in New Issue
Block a user