mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-21 16:52:06 -07:00
linting
This commit is contained in:
@@ -13,7 +13,7 @@ const { Text } = Inputs
|
||||
|
||||
let _this
|
||||
class JsonWebTokens extends React.Component {
|
||||
constructor(props) {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
|
||||
_this = this
|
||||
@@ -26,7 +26,7 @@ class JsonWebTokens extends React.Component {
|
||||
_this.BchWallet = BchWallet
|
||||
}
|
||||
|
||||
render() {
|
||||
render () {
|
||||
return (
|
||||
<Row>
|
||||
<Col sm={12}>
|
||||
@@ -70,7 +70,7 @@ class JsonWebTokens extends React.Component {
|
||||
)
|
||||
}
|
||||
|
||||
setJwt() {
|
||||
setJwt () {
|
||||
const { JWT } = _this.props.walletInfo
|
||||
if (JWT) {
|
||||
const jwtElem = document.getElementById('jwt')
|
||||
@@ -78,36 +78,35 @@ class JsonWebTokens extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleUpdate(event) {
|
||||
handleUpdate (event) {
|
||||
const value = event.target.value
|
||||
_this.setState({
|
||||
[event.target.name]: value
|
||||
})
|
||||
}
|
||||
|
||||
async handleUpdateJWT() {
|
||||
async handleUpdateJWT () {
|
||||
try {
|
||||
const { mnemonic, selectedServer } = _this.props.walletInfo
|
||||
const _interface = _this.props.walletInfo.interface
|
||||
|
||||
|
||||
const apiToken = _this.state.JWT
|
||||
|
||||
// Update instance with JWT
|
||||
if (mnemonic) {
|
||||
let bchjsOptions = { apiToken: apiToken }
|
||||
const bchjsOptions = { apiToken: apiToken }
|
||||
if (selectedServer) {
|
||||
bchjsOptions.restURL = selectedServer
|
||||
}
|
||||
|
||||
bchjsOptions.interface = _interface
|
||||
//console.log('bchjs options : ', bchjsOptions)
|
||||
// console.log('bchjs options : ', bchjsOptions)
|
||||
const bchWalletLib = new _this.BchWallet(mnemonic, bchjsOptions)
|
||||
|
||||
// Update bchjs instances of minimal-slp-wallet libraries
|
||||
bchWalletLib.tokens.sendBch.bchjs = new bchWalletLib.BCHJS(bchjsOptions)
|
||||
bchWalletLib.tokens.utxos.bchjs = new bchWalletLib.BCHJS(bchjsOptions)
|
||||
|
||||
|
||||
_this.props.setBchWallet(bchWalletLib)
|
||||
}
|
||||
|
||||
@@ -124,7 +123,7 @@ class JsonWebTokens extends React.Component {
|
||||
}
|
||||
|
||||
// Reset form and component state
|
||||
resetValues() {
|
||||
resetValues () {
|
||||
_this.setState({
|
||||
JWT: '',
|
||||
errMsg: ''
|
||||
@@ -133,7 +132,7 @@ class JsonWebTokens extends React.Component {
|
||||
jwtElem.value = ''
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
componentDidMount () {
|
||||
_this.setJwt()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ class Servers extends React.Component {
|
||||
|
||||
bchjsOptions.restURL = restURL
|
||||
bchjsOptions.interface = _interface
|
||||
//console.log('bchjs options : ', bchjsOptions)
|
||||
// console.log('bchjs options : ', bchjsOptions)
|
||||
|
||||
const bchWalletLib = new _this.BchWallet(mnemonic, bchjsOptions)
|
||||
|
||||
|
||||
@@ -60,18 +60,18 @@ class AdminLTEPage extends React.Component {
|
||||
<AdminLTE
|
||||
title={[siteConfig.title]}
|
||||
titleShort={[siteConfig.titleShort]}
|
||||
theme="blue"
|
||||
theme='blue'
|
||||
>
|
||||
<Sidebar.Core>
|
||||
<Item key="Balance" text="Balance" icon={siteConfig.balanceIcon}>
|
||||
<Item key='Balance' text='Balance' icon={siteConfig.balanceIcon}>
|
||||
<Box
|
||||
className="hover-shadow border-none background-none"
|
||||
className='hover-shadow border-none background-none'
|
||||
loaded={!_this.state.inFetch}
|
||||
>
|
||||
<div className="sidebar-balance">
|
||||
<div className='sidebar-balance'>
|
||||
<div>
|
||||
{!_this.state.inFetch && (
|
||||
<div className="siderbar-balance-content">
|
||||
<div className='siderbar-balance-content'>
|
||||
<span>
|
||||
<h3>{siteConfig.balanceText}</h3>
|
||||
|
||||
@@ -81,9 +81,9 @@ class AdminLTEPage extends React.Component {
|
||||
<small>USD: ${_this.state.usdBalance}</small>
|
||||
</span>
|
||||
<FontAwesomeIcon
|
||||
className="ml-1 icon"
|
||||
size="lg"
|
||||
icon="redo"
|
||||
className='ml-1 icon'
|
||||
size='lg'
|
||||
icon='redo'
|
||||
onClick={_this.handleGetBalance}
|
||||
/>
|
||||
</div>
|
||||
@@ -101,8 +101,8 @@ class AdminLTEPage extends React.Component {
|
||||
<Navbar.Core>
|
||||
<VersionStatus />
|
||||
</Navbar.Core>
|
||||
<Layout path="/" {..._this.props}>
|
||||
<div className="components-container">
|
||||
<Layout path='/' {..._this.props}>
|
||||
<div className='components-container'>
|
||||
{_this.renderNewViewItems(_this.props)}
|
||||
</div>
|
||||
</Layout>
|
||||
@@ -132,7 +132,7 @@ class AdminLTEPage extends React.Component {
|
||||
await bchWalletLib.walletInfoPromise
|
||||
const myBalance = await bchWalletLib.getBalance()
|
||||
|
||||
const bchjs = bchWalletLib.bchjs
|
||||
// const bchjs = bchWalletLib.bchjs
|
||||
|
||||
const currentRate = (await bchWalletLib.getUsd()) * 100
|
||||
console.log('currentRate: ', currentRate)
|
||||
@@ -387,7 +387,7 @@ class AdminLTEPage extends React.Component {
|
||||
return (
|
||||
<li style={{ display: 'none' }}>
|
||||
{/* Adding this childrens prevents console errors */}
|
||||
<a href="#">
|
||||
<a href='#'>
|
||||
<span />
|
||||
<span />
|
||||
</a>
|
||||
|
||||
@@ -31,22 +31,22 @@ class Tokens extends React.Component {
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
text="Refresh"
|
||||
icon="fa-redo"
|
||||
type="primary"
|
||||
className="btn-md ml-1 mt-1 mb-1"
|
||||
text='Refresh'
|
||||
icon='fa-redo'
|
||||
type='primary'
|
||||
className='btn-md ml-1 mt-1 mb-1'
|
||||
onClick={() => _this.handleGetTokens(true)}
|
||||
/>
|
||||
{_this.state.txId && (
|
||||
<div className="txIdContainer">
|
||||
<div className='txIdContainer'>
|
||||
<button onClick={() => _this.setState({ txId: null })}>
|
||||
×
|
||||
</button>
|
||||
<Col xs={12} className="text-center mt-1">
|
||||
<Box title="Transaction ID" type="primary" className="p-0">
|
||||
<Col xs={12} className='text-center mt-1'>
|
||||
<Box title='Transaction ID' type='primary' className='p-0'>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
href={`${_this.state.explorerURL}/${_this.state.txId}`}
|
||||
>
|
||||
{_this.state.txId}
|
||||
@@ -71,46 +71,46 @@ class Tokens extends React.Component {
|
||||
)}
|
||||
{_this.state.inFetch
|
||||
? (
|
||||
<div className="spinner">
|
||||
<img alt="Loading..." src={Spinner} width={100} />
|
||||
</div>
|
||||
<div className='spinner'>
|
||||
<img alt='Loading...' src={Spinner} width={100} />
|
||||
</div>
|
||||
)
|
||||
: (
|
||||
<Content>
|
||||
{_this.state.errMsg && (
|
||||
<Box padding="true" className="container-nofound">
|
||||
<Row>
|
||||
<Col xs={12}>
|
||||
<em>{_this.state.errMsg}</em>
|
||||
</Col>
|
||||
</Row>
|
||||
</Box>
|
||||
)}
|
||||
<Content>
|
||||
{_this.state.errMsg && (
|
||||
<Box padding='true' className='container-nofound'>
|
||||
<Row>
|
||||
<Col xs={12}>
|
||||
<em>{_this.state.errMsg}</em>
|
||||
</Col>
|
||||
</Row>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{_this.state.tokens.length > 0 && (
|
||||
<>
|
||||
<Row>
|
||||
{_this.state.tokens.map((val, i) => {
|
||||
if (val.qty > 0) {
|
||||
return (
|
||||
<Col sm={4} key={`token-${i}`}>
|
||||
<TokenCard
|
||||
key={`token-${i}`}
|
||||
id={`token-${i}`}
|
||||
token={val}
|
||||
showToken={_this.showToken}
|
||||
selectToken={_this.selectToken}
|
||||
/>
|
||||
</Col>
|
||||
)
|
||||
} else {
|
||||
return <span key={`token-${i}`} />
|
||||
}
|
||||
})}
|
||||
</Row>
|
||||
</>
|
||||
)}
|
||||
</Content>
|
||||
{_this.state.tokens.length > 0 && (
|
||||
<>
|
||||
<Row>
|
||||
{_this.state.tokens.map((val, i) => {
|
||||
if (val.qty > 0) {
|
||||
return (
|
||||
<Col sm={4} key={`token-${i}`}>
|
||||
<TokenCard
|
||||
key={`token-${i}`}
|
||||
id={`token-${i}`}
|
||||
token={val}
|
||||
showToken={_this.showToken}
|
||||
selectToken={_this.selectToken}
|
||||
/>
|
||||
</Col>
|
||||
)
|
||||
} else {
|
||||
return <span key={`token-${i}`} />
|
||||
}
|
||||
})}
|
||||
</Row>
|
||||
</>
|
||||
)}
|
||||
</Content>
|
||||
)}
|
||||
<TokenModal
|
||||
bchWallet={_this.props.bchWallet}
|
||||
@@ -227,9 +227,9 @@ class Tokens extends React.Component {
|
||||
Rate limits exceeded, increase rate limits with a JWT token from
|
||||
<a
|
||||
style={{ marginLeft: '5px' }}
|
||||
target="_blank"
|
||||
href="https://fullstack.cash"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
href='https://fullstack.cash'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
FullStack.cash
|
||||
</a>
|
||||
|
||||
@@ -35,72 +35,72 @@ class SendTokens extends React.Component {
|
||||
<>
|
||||
<Row>
|
||||
<Col sm={12}>
|
||||
<Box className=" border-none mt-2" loaded={!this.state.inFetch}>
|
||||
<Box className=' border-none mt-2' loaded={!this.state.inFetch}>
|
||||
<Row>
|
||||
<Col sm={12} className="text-center">
|
||||
<h1 id="SendTokens">
|
||||
<Col sm={12} className='text-center'>
|
||||
<h1 id='SendTokens'>
|
||||
<FontAwesomeIcon
|
||||
className="title-icon"
|
||||
size="xs"
|
||||
icon="paper-plane"
|
||||
className='title-icon'
|
||||
size='xs'
|
||||
icon='paper-plane'
|
||||
/>
|
||||
<span>Send</span>
|
||||
</h1>
|
||||
|
||||
<Box className="border-none">
|
||||
<Box className='border-none'>
|
||||
<Text
|
||||
id="addressToSend"
|
||||
name="address"
|
||||
placeholder="Enter simpleledger address to send"
|
||||
label="SLP Address"
|
||||
labelPosition="above"
|
||||
id='addressToSend'
|
||||
name='address'
|
||||
placeholder='Enter simpleledger address to send'
|
||||
label='SLP Address'
|
||||
labelPosition='above'
|
||||
onChange={_this.handleUpdate}
|
||||
className="title-icon"
|
||||
className='title-icon'
|
||||
buttonRight={
|
||||
<Button icon="fa-qrcode" onClick={_this.handleModal} />
|
||||
<Button icon='fa-qrcode' onClick={_this.handleModal} />
|
||||
}
|
||||
/>
|
||||
|
||||
<Text
|
||||
id="amountToSend"
|
||||
name="amountSat"
|
||||
placeholder="Enter amount to send"
|
||||
label="Amount"
|
||||
id='amountToSend'
|
||||
name='amountSat'
|
||||
placeholder='Enter amount to send'
|
||||
label='Amount'
|
||||
value={_this.state.amountSat}
|
||||
labelPosition="above"
|
||||
labelPosition='above'
|
||||
onChange={_this.handleUpdate}
|
||||
/>
|
||||
<Row className="token-botton-container">
|
||||
<Row className='token-botton-container'>
|
||||
<Col xs={12} sm={4}>
|
||||
<Button
|
||||
text="Send"
|
||||
type="primary"
|
||||
className="btn-lg btn-send-token mr-1 ml-1 mt-1"
|
||||
text='Send'
|
||||
type='primary'
|
||||
className='btn-lg btn-send-token mr-1 ml-1 mt-1'
|
||||
onClick={_this.handleSend}
|
||||
/>
|
||||
</Col>
|
||||
<Col xs={12} sm={4}>
|
||||
<Button
|
||||
text="Send Max"
|
||||
type="primary"
|
||||
className="btn-lg btn-send-token mr-1 ml-1 mt-1"
|
||||
text='Send Max'
|
||||
type='primary'
|
||||
className='btn-lg btn-send-token mr-1 ml-1 mt-1'
|
||||
onClick={_this.handleSendMax}
|
||||
/>
|
||||
</Col>
|
||||
<Col xs={12} sm={4}>
|
||||
<Button
|
||||
text="Close"
|
||||
type="primary"
|
||||
className="btn-lg btn-send-token mr-1 ml-1 mt-1"
|
||||
text='Close'
|
||||
type='primary'
|
||||
className='btn-lg btn-send-token mr-1 ml-1 mt-1'
|
||||
onClick={_this.props.handleBack}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Box>
|
||||
</Col>
|
||||
<Col sm={12} className="text-center">
|
||||
<Col sm={12} className='text-center'>
|
||||
{_this.state.errMsg && (
|
||||
<p className="error-color">{_this.state.errMsg}</p>
|
||||
<p className='error-color'>{_this.state.errMsg}</p>
|
||||
)}
|
||||
{/* {_this.state.txId && (
|
||||
<p className=''>
|
||||
@@ -351,9 +351,9 @@ class SendTokens extends React.Component {
|
||||
Rate limits exceeded, increase rate limits with a JWT token from
|
||||
<a
|
||||
style={{ marginLeft: '5px' }}
|
||||
target="_blank"
|
||||
href="https://fullstack.cash"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
href='https://fullstack.cash'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
FullStack.cash
|
||||
</a>
|
||||
|
||||
@@ -28,31 +28,31 @@ class NewWallet extends React.Component {
|
||||
<Col sm={2} />
|
||||
<Col sm={8}>
|
||||
<Box
|
||||
className="hover-shadow border-none mt-2"
|
||||
className='hover-shadow border-none mt-2'
|
||||
loaded={!_this.state.inFetch}
|
||||
>
|
||||
<Row>
|
||||
<Col sm={12} className="text-center">
|
||||
<Col sm={12} className='text-center'>
|
||||
<h1>
|
||||
<FontAwesomeIcon
|
||||
className="title-icon"
|
||||
size="xs"
|
||||
icon="plus"
|
||||
className='title-icon'
|
||||
size='xs'
|
||||
icon='plus'
|
||||
/>
|
||||
<span>New Wallet</span>
|
||||
</h1>
|
||||
</Col>
|
||||
<Col sm={12} className="text-center mt-2 mb-2">
|
||||
<Col sm={12} className='text-center mt-2 mb-2'>
|
||||
<Button
|
||||
text="Create Wallet"
|
||||
type="primary"
|
||||
className="btn-lg"
|
||||
text='Create Wallet'
|
||||
type='primary'
|
||||
className='btn-lg'
|
||||
onClick={_this.handleCreateWallet}
|
||||
/>
|
||||
</Col>
|
||||
<Col sm={12} className="text-center ">
|
||||
<Col sm={12} className='text-center '>
|
||||
{_this.state.errMsg && (
|
||||
<p className="error-color mt-2">{_this.state.errMsg}</p>
|
||||
<p className='error-color mt-2'>{_this.state.errMsg}</p>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
@@ -174,9 +174,9 @@ class NewWallet extends React.Component {
|
||||
Rate limits exceeded, increase rate limits with a JWT token from
|
||||
<a
|
||||
style={{ marginLeft: '5px' }}
|
||||
target="_blank"
|
||||
href="https://fullstack.cash"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
href='https://fullstack.cash'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
FullStack.cash
|
||||
</a>
|
||||
|
||||
@@ -28,51 +28,51 @@ class ImportWallet extends React.Component {
|
||||
|
||||
render () {
|
||||
return (
|
||||
<Row className="">
|
||||
<Row className=''>
|
||||
<Col sm={2} />
|
||||
<Col sm={8}>
|
||||
<Box
|
||||
className="hover-shadow border-none mt-2"
|
||||
className='hover-shadow border-none mt-2'
|
||||
loaded={!_this.state.inFetch}
|
||||
>
|
||||
<Row>
|
||||
<Col sm={12} className="text-center">
|
||||
<Col sm={12} className='text-center'>
|
||||
<h1>
|
||||
<FontAwesomeIcon
|
||||
className="title-icon"
|
||||
size="xs"
|
||||
icon="file-import"
|
||||
className='title-icon'
|
||||
size='xs'
|
||||
icon='file-import'
|
||||
/>
|
||||
<span>Import Wallet</span>
|
||||
</h1>
|
||||
</Col>
|
||||
<Col sm={12} className="text-center mt-2 mb-2">
|
||||
<Row className="flex justify-content-center">
|
||||
<Col sm={12} className='text-center mt-2 mb-2'>
|
||||
<Row className='flex justify-content-center'>
|
||||
<Col sm={8}>
|
||||
<form autoComplete="off">
|
||||
<form autoComplete='off'>
|
||||
<Text
|
||||
id="import-mnemonic"
|
||||
name="mnemonic"
|
||||
placeholder="12 word mnemonic"
|
||||
label="12 word mnemonic"
|
||||
labelPosition="above"
|
||||
id='import-mnemonic'
|
||||
name='mnemonic'
|
||||
placeholder='12 word mnemonic'
|
||||
label='12 word mnemonic'
|
||||
labelPosition='above'
|
||||
onChange={_this.handleUpdate}
|
||||
/>
|
||||
</form>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col sm={12} className="text-center mb-2">
|
||||
<Col sm={12} className='text-center mb-2'>
|
||||
<Button
|
||||
text="Import"
|
||||
type="primary"
|
||||
className="btn-lg"
|
||||
text='Import'
|
||||
type='primary'
|
||||
className='btn-lg'
|
||||
onClick={_this.handleImportWallet}
|
||||
/>
|
||||
</Col>
|
||||
<Col sm={12} className="text-center">
|
||||
<Col sm={12} className='text-center'>
|
||||
{_this.state.errMsg && (
|
||||
<p className="error-color">{_this.state.errMsg}</p>
|
||||
<p className='error-color'>{_this.state.errMsg}</p>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
@@ -240,9 +240,9 @@ class ImportWallet extends React.Component {
|
||||
Rate limits exceeded, increase rate limits with a JWT token from
|
||||
<a
|
||||
style={{ marginLeft: '5px' }}
|
||||
target="_blank"
|
||||
href="https://fullstack.cash"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
href='https://fullstack.cash'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
FullStack.cash
|
||||
</a>
|
||||
|
||||
@@ -59,28 +59,28 @@ class Footer extends React.Component {
|
||||
|
||||
render () {
|
||||
return (
|
||||
<section id="footer">
|
||||
<Row className="footer-container">
|
||||
<Col md={12} className="footer-section">
|
||||
<section id='footer'>
|
||||
<Row className='footer-container'>
|
||||
<Col md={12} className='footer-section'>
|
||||
<Row>
|
||||
<Col md={12} className="mb-1">
|
||||
<p className="section-tittle">Produced By</p>
|
||||
<Col md={12} className='mb-1'>
|
||||
<p className='section-tittle'>Produced By</p>
|
||||
|
||||
<a
|
||||
href={siteConfig.hostUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
{siteConfig.hostText}
|
||||
</a>
|
||||
</Col>
|
||||
<Col md={12}>
|
||||
<p className="section-tittle">Source Code</p>
|
||||
<FontAwesomeIcon className="" size="lg" icon={faGithub} />
|
||||
<p className='section-tittle'>Source Code</p>
|
||||
<FontAwesomeIcon className='' size='lg' icon={faGithub} />
|
||||
<a
|
||||
href={siteConfig.sourceCode}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
Github
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user