From 187bfe23e53db48eac4baf01bb9a7eb66841837b Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Tue, 7 Jul 2020 03:09:46 -0400 Subject: [PATCH 1/2] fix(issues): Fixed some visual issues --- src/components/admin-lte/index.js | 75 ++++++++++--------- src/components/admin-lte/send-receive/send.js | 4 +- src/components/admin-lte/tokens/index.js | 2 +- .../admin-lte/tokens/token-modal.js | 32 ++++---- src/components/qr-scanner/modal.js | 6 +- 5 files changed, 63 insertions(+), 56 deletions(-) diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index e728a83..87bade3 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' @@ -39,21 +40,21 @@ class AdminLTEPage extends React.Component { _this.BchWallet = BchWallet _this.sidebar = [ - , - , - , - , - + , + , + , + , + ] } render () { return ( <> - + - -
+ +

BCH Balance

@@ -70,9 +71,8 @@ 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) { @@ -271,6 +263,9 @@ class AdminLTEPage extends React.Component { _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,34 @@ 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..b0e8950 100644 --- a/src/components/admin-lte/send-receive/send.js +++ b/src/components/admin-lte/send-receive/send.js @@ -89,8 +89,8 @@ class Send extends React.Component { diff --git a/src/components/admin-lte/tokens/index.js b/src/components/admin-lte/tokens/index.js index f32ca2e..b7a0bfc 100644 --- a/src/components/admin-lte/tokens/index.js +++ b/src/components/admin-lte/tokens/index.js @@ -81,7 +81,7 @@ class Tokens extends React.Component { )} diff --git a/src/components/admin-lte/tokens/token-modal.js b/src/components/admin-lte/tokens/token-modal.js index 2c31adc..127a874 100644 --- a/src/components/admin-lte/tokens/token-modal.js +++ b/src/components/admin-lte/tokens/token-modal.js @@ -13,7 +13,7 @@ class TokenModal extends React.Component { this.modalFooter = ( <> -