From ce3dca5d478255dd0492e7628302a954d43134e1 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Wed, 1 Jul 2020 19:26:17 -0700 Subject: [PATCH] Changing order of menu items --- src/components/admin-lte/index.js | 165 +++++++++++++++++------------- 1 file changed, 92 insertions(+), 73 deletions(-) diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index e52e2d9..e8938c4 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -25,8 +25,8 @@ const MENU_HIDE_WIDTH = 770 let _this const MenuItemComponent = ({ component }) => { - const RenderedComponent = loadable(() => import("./audit")) - return () + const RenderedComponent = loadable(() => import("./audit")) + return } class AdminLTEPage extends React.Component { @@ -44,85 +44,105 @@ class AdminLTEPage extends React.Component { } sidebar = [ - , - , - , - , , - + , + , + , + ] render() { return ( - <> - - - -
-
-

BCH Balance

+ query { + bchWalletPlugins { + menuItems { + title + component + icon + } + } + } + `} + render={data => ( + <> + + + +
+
+

BCH Balance

-

{_this.state.bchBalance}

-
-
-
- - {_this.sidebar} - {data.bchWalletPlugins.menuItems.map(item => )} -
- - - - -
- {_this.state.section === "Wallet" && ( - - )} - {_this.state.section === "Tokens" && - - } - {_this.state.section === "Configure" && ( - - )} - {data.bchWalletPlugins.menuItems.map(item => - _this.state.section === item.title && - )} +

{_this.state.bchBalance}

-
-
- - - - - }/> +
+ + {_this.sidebar} + {data.bchWalletPlugins.menuItems.map(item => ( + + ))} + + + + + +
+ {_this.state.section === "Send/Receive" && ( + + )} + {_this.state.section === "Tokens" && ( + + )} + {_this.state.section === "Wallet" && ( + + )} + + {_this.state.section === "Configure" && ( + + )} + {data.bchWalletPlugins.menuItems.map( + item => + _this.state.section === item.title && ( + + ) + )} +
+
+ + + + + + )} + /> ) } // Get wallet balance @@ -130,7 +150,6 @@ class AdminLTEPage extends React.Component { try { const { mnemonic } = _this.props.walletInfo if (mnemonic && _this.props.bchWallet) { - const bchWalletLib = _this.props.bchWallet await bchWalletLib.walletInfoPromise @@ -273,7 +292,7 @@ AdminLTEPage.propTypes = { setWalletInfo: PropTypes.func.isRequired, // set wallet info updateBalance: PropTypes.func.isRequired, // update bch balance setBchWallet: PropTypes.func.isRequired, // set minimal-slp-wallet instance - bchWallet:PropTypes.object, // get minimal-slp-wallet instance + bchWallet: PropTypes.object, // get minimal-slp-wallet instance } export default AdminLTEPage