From a4dd8771f620814bf4022540d3f8ed3fde9a367b Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 2 Jul 2021 13:45:22 +1000 Subject: [PATCH] re-arrange app bar and display address in use --- examples/eth-dm/src/App.tsx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/examples/eth-dm/src/App.tsx b/examples/eth-dm/src/App.tsx index 82ac3b7ff9..1d0de0594a 100644 --- a/examples/eth-dm/src/App.tsx +++ b/examples/eth-dm/src/App.tsx @@ -52,7 +52,13 @@ const useStyles = makeStyles({ flex: 1, margin: '10px', }, - wakuStatus: {}, + wakuStatus: { + marginRight: theme.spacing(2), + }, + title: { + flexGrow: 1, + }, + peers: {}, }); function App() { @@ -79,19 +85,24 @@ function App() { } }, [address, signer]); - let peers; + let peers = 0; if (waku) { peers = waku.libp2p.connectionManager.connections.size; } + let addressDisplay = ''; + if (address) { + addressDisplay = + address.substr(0, 6) + '...' + address.substr(address.length - 4, 4); + } + return (
- Ethereum Direct Message @@ -100,7 +111,13 @@ function App() { style={waku ? { color: green[500] } : {}} /> - {peers} + + {peers} peer{peers && peers > 1 ? 's' : ''} + + + Ethereum Direct Message + + {addressDisplay}