diff --git a/src/components/admin-lte/send-receive/index.js b/src/components/admin-lte/send-receive/index.js index a4993b7..53c27de 100644 --- a/src/components/admin-lte/send-receive/index.js +++ b/src/components/admin-lte/send-receive/index.js @@ -1,10 +1,11 @@ import React from "react" import PropTypes from "prop-types" -import { Content } from "adminlte-2-react" +import { Content, Row, Col, Box } from "adminlte-2-react" import Receive from "./receive" import Send from "./send" -import './send-receive.css' +import "./send-receive.css" + let _this class SendReceive extends React.Component { constructor(props) { @@ -16,16 +17,25 @@ class SendReceive extends React.Component { render() { return ( <> - - - - - + {_this.props.walletInfo.mnemonic ? ( + + + + + ) : ( + + + + + You need to create or import a wallet first + + + + + )} ) } @@ -35,7 +45,7 @@ SendReceive.propTypes = { walletInfo: PropTypes.object.isRequired, updateBalance: PropTypes.func.isRequired, setBchWallet: PropTypes.func.isRequired, - bchWallet:PropTypes.object, + bchWallet: PropTypes.object, } export default SendReceive diff --git a/src/components/admin-lte/send-receive/send.js b/src/components/admin-lte/send-receive/send.js index 90688bb..f574440 100644 --- a/src/components/admin-lte/send-receive/send.js +++ b/src/components/admin-lte/send-receive/send.js @@ -3,11 +3,11 @@ import PropTypes from "prop-types" import { Content, Row, Col, Box, Inputs, Button } from "adminlte-2-react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import BchWallet from "minimal-slp-wallet" - +import ScannerModal from "../../qr-scanner/modal" const { Text } = Inputs let _this -class Configure extends React.Component { +class Send extends React.Component { constructor(props) { super(props) @@ -18,69 +18,90 @@ class Configure extends React.Component { amountSat: "", errMsg: "", txId: "", + showScan: false, } _this.BchWallet = BchWallet } render() { return ( - - - - - - - -

- - Send -

- - - - + -

{this.state.result}

+ +

{this.state.result}

+
) } changeMode() { - let mode = _this.state.facingMode === 'user' ? - 'environment' : 'user' + let mode = _this.state.facingMode === "user" ? "environment" : "user" console.log(`changing to ${mode} mode`) _this.setState({ - facingMode: mode + facingMode: mode, }) } } - +QScanner.propTypes = { + onError: PropTypes.func, + onScan: PropTypes.func, +} export default QScanner