diff --git a/explorer/src/App.tsx b/explorer/src/App.tsx index df3daba38..3d4236e8a 100644 --- a/explorer/src/App.tsx +++ b/explorer/src/App.tsx @@ -1,20 +1,6 @@ import React from "react"; import { Link } from "react-router-dom"; -import { ClusterProvider } from "./providers/cluster"; -import { - TransactionsProvider, - useTransactionsDispatch, - useTransactions, - ActionType -} from "./providers/transactions"; -import { - AccountsProvider, - useSelectedAccount, - useAccountsDispatch, - ActionType as AccountActionType -} from "./providers/accounts"; -import { BlocksProvider } from "./providers/blocks"; import ClusterStatusButton from "./components/ClusterStatusButton"; import AccountsCard from "./components/AccountsCard"; import TransactionsCard from "./components/TransactionsCard"; @@ -28,82 +14,70 @@ function App() { const [showClusterModal, setShowClusterModal] = React.useState(false); const currentTab = useCurrentTab(); return ( - - - - - setShowClusterModal(false)} - /> - - -
- + <> + setShowClusterModal(false)} + /> + + +
+ -
-
-
-
-
- setShowClusterModal(true)} - /> -
-
-
-
-
    -
  • - -
  • -
  • - -
  • -
-
-
- setShowClusterModal(true)} - /> -
-
-
+
+
+
+
+
+ setShowClusterModal(true)} + />
- -
-
-
- {currentTab === "Transactions" ? ( - - ) : null} -
+
+
+
    +
  • + +
  • +
  • + +
  • +
-
-
- {currentTab === "Accounts" ? : null} -
+
+ setShowClusterModal(true)} + />
- setShowClusterModal(false)} - /> - - - - +
+
+ +
+
+
+ {currentTab === "Transactions" ? : null} +
+
+
+
+ {currentTab === "Accounts" ? : null} +
+
+
+
+ ); } @@ -120,30 +94,4 @@ function NavLink({ href, tab }: { href: string; tab: Tab }) { ); } -type OverlayProps = { - show: boolean; - onClick: () => void; -}; - -function Overlay({ show, onClick }: OverlayProps) { - const { selected } = useTransactions(); - const selectedAccount = useSelectedAccount(); - const txDispatch = useTransactionsDispatch(); - const accountDispatch = useAccountsDispatch(); - - if (show || !!selected || !!selectedAccount) - return ( -
{ - onClick(); - txDispatch({ type: ActionType.Deselect }); - accountDispatch({ type: AccountActionType.Select }); - }} - >
- ); - - return
; -} - export default App; diff --git a/explorer/src/components/AccountModal.tsx b/explorer/src/components/AccountModal.tsx index 9a8fedf31..d76fff8b5 100644 --- a/explorer/src/components/AccountModal.tsx +++ b/explorer/src/components/AccountModal.tsx @@ -8,6 +8,7 @@ import { } from "../providers/accounts"; import { TransactionError } from "@solana/web3.js"; import Copyable from "./Copyable"; +import Overlay from "./Overlay"; function AccountModal() { const selected = useSelectedAccount(); @@ -37,9 +38,12 @@ function AccountModal() { }; return ( -
- {renderContent()} -
+ <> +
+ {renderContent()} +
+ + ); } diff --git a/explorer/src/components/ClusterModal.tsx b/explorer/src/components/ClusterModal.tsx index 038a9ac2a..9ce05bf6d 100644 --- a/explorer/src/components/ClusterModal.tsx +++ b/explorer/src/components/ClusterModal.tsx @@ -10,6 +10,7 @@ import { Cluster } from "../providers/cluster"; import { assertUnreachable } from "../utils"; +import Overlay from "./Overlay"; type Props = { show: boolean; @@ -18,24 +19,28 @@ type Props = { function ClusterModal({ show, onClose }: Props) { return ( -
-
-
-
e.stopPropagation()}> - - × - + <> +
+
+
+
e.stopPropagation()}> + + × + -

Choose a Cluster

+

Choose a Cluster

- + +
-
+ + + ); } diff --git a/explorer/src/components/Overlay.tsx b/explorer/src/components/Overlay.tsx new file mode 100644 index 000000000..ba8c792d2 --- /dev/null +++ b/explorer/src/components/Overlay.tsx @@ -0,0 +1,9 @@ +import React from "react"; + +type OverlayProps = { + show: boolean; +}; + +export default function Overlay({ show }: OverlayProps) { + return
; +} diff --git a/explorer/src/components/TransactionModal.tsx b/explorer/src/components/TransactionModal.tsx index 78cfccad3..ecd47a384 100644 --- a/explorer/src/components/TransactionModal.tsx +++ b/explorer/src/components/TransactionModal.tsx @@ -14,6 +14,7 @@ import { TransactionInstruction } from "@solana/web3.js"; import Copyable from "./Copyable"; +import Overlay from "./Overlay"; function TransactionModal() { const { selected } = useTransactions(); @@ -43,9 +44,12 @@ function TransactionModal() { }; return ( -
- {renderContent()} -
+ <> +
+ {renderContent()} +
+ + ); } diff --git a/explorer/src/index.tsx b/explorer/src/index.tsx index a8558fa01..71f7dcfe4 100644 --- a/explorer/src/index.tsx +++ b/explorer/src/index.tsx @@ -4,12 +4,24 @@ import { BrowserRouter as Router } from "react-router-dom"; import "./scss/theme.scss"; import App from "./App"; import * as serviceWorker from "./serviceWorker"; +import { ClusterProvider } from "./providers/cluster"; +import { BlocksProvider } from "./providers/blocks"; +import { TransactionsProvider } from "./providers/transactions"; +import { AccountsProvider } from "./providers/accounts"; import { TabProvider } from "./providers/tab"; ReactDOM.render( - + + + + + + + + + , document.getElementById("root") diff --git a/explorer/src/scss/_solana.scss b/explorer/src/scss/_solana.scss index 37091dcde..4e695c7fb 100644 --- a/explorer/src/scss/_solana.scss +++ b/explorer/src/scss/_solana.scss @@ -32,6 +32,10 @@ code { } } +.modal-backdrop { + pointer-events: none; +} + .modal.show { display: block; }