Skip to content

Commit

Permalink
Small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry authored and mvines committed Jun 12, 2020
1 parent 3c69b34 commit 279cd78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 5 additions & 4 deletions explorer/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";

import { NetworkProvider } from "./providers/network";
import { TransactionsProvider } from "./providers/transactions";
import NetworkStatusButton from "./components/NetworkStatusButton";
Expand Down Expand Up @@ -37,7 +38,6 @@ function App() {
</div>
</div>
</div>

<Overlay show={showModal} onClick={() => setShowModal(false)} />
</NetworkProvider>
);
Expand All @@ -49,9 +49,10 @@ type OverlayProps = {
};

function Overlay({ show, onClick }: OverlayProps) {
return show ? (
<div className="modal-backdrop fade show" onClick={onClick}></div>
) : null;
if (show)
return <div className="modal-backdrop fade show" onClick={onClick}></div>;

return <div className="fade"></div>;
}

export default App;
7 changes: 2 additions & 5 deletions explorer/src/components/NetworkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ type Props = {
};

function NetworkModal({ show, onClose }: Props) {
const cancelClose = React.useCallback(e => e.stopPropagation(), []);

return (
<div
className={`modal fade fixed-right ${show ? "show" : ""}`}
tabIndex={-1}
className={`modal fade fixed-right${show ? " show" : ""}`}
onClick={onClose}
>
<div className="modal-dialog modal-dialog-vertical">
<div className="modal-content">
<div className="modal-body" onClick={cancelClose}>
<div className="modal-body" onClick={e => e.stopPropagation()}>
<span className="close" onClick={onClose}>
&times;
</span>
Expand Down

0 comments on commit 279cd78

Please sign in to comment.