diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index e728a83..2a9aaa7 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types' import Configure from './configure' import Tokens from './tokens' import Wallet from './wallet' + // import Audit from "./audit" import AdminLTE, { Sidebar, Navbar } from 'adminlte-2-react' @@ -72,7 +73,6 @@ class AdminLTEPage extends React.Component {
- {_this.state.section === 'Send/Receive' && ( )} - {_this.state.section === 'Wallet' && ( - - )} - {_this.state.section === 'Configure' && ( @@ -199,7 +189,9 @@ class AdminLTEPage extends React.Component { childrens[i].id = textValue const ignore = ignoreItems.find(val => textValue === val) // Ignore menu items without link to components - if (!ignore) { childrens[i].onclick = () => this.changeSection(textValue) } + if (!ignore) { + childrens[i].onclick = () => this.changeSection(textValue) + } } } } catch (error) { @@ -257,20 +249,23 @@ class AdminLTEPage extends React.Component { addOnClickEventToScanner () { try { const qrScannerEle = document.getElementById('Qr Scanner') - qrScannerEle.onclick = () => _this.handleToggleScannerModal() + qrScannerEle.onclick = () => _this.onHandleToggleScannerModal() } catch (error) { console.error(error) } } // Controller to show the QR scanner - handleToggleScannerModal () { + onHandleToggleScannerModal () { if (!_this.state.showScannerModal) { _this.hideMenu() } _this.setState({ showScannerModal: !_this.state.showScannerModal }) + setTimeout(() => { + console.log(_this.state.showScannerModal) + }, 500) } // Render non-default menu items. The catch ensures that the render function @@ -280,22 +275,35 @@ class AdminLTEPage extends React.Component { return menuComponents && menuComponents.map(m => m.menuItem) } catch (err) { // TODO: Figure out how to return an invisible Item. - return + return _this.getInvisibleMenuItem() // } } // Displays the View corresponding to the dynamically loaded menu item. renderNewViewItems () { try { - return (menuComponents && menuComponents.map(m => { - if (_this.state.section === m.key) { - return m.component - } - return '' - })) - } catch (err) { + return ( + menuComponents && + menuComponents.map(m => { + if (_this.state.section === m.key) { + return m.component + } + return '' + }) + ) + } catch (err) {} + } - } + getInvisibleMenuItem () { + return ( +
  • + {/* Adding this childrens prevents console errors */} + + + + +
  • + ) } } // Props prvided by redux diff --git a/src/components/admin-lte/send-receive/send.js b/src/components/admin-lte/send-receive/send.js index 40e487e..cb06c75 100644 --- a/src/components/admin-lte/send-receive/send.js +++ b/src/components/admin-lte/send-receive/send.js @@ -53,7 +53,7 @@ class Send extends React.Component { buttonRight={