fix(linting): Adding linting libs and updating deps

This commit is contained in:
Chris Troutner
2021-01-05 17:34:44 -08:00
parent cc3e9b33f7
commit 49bd409786
12 changed files with 3094 additions and 2150 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ const normalConfig = [
options: { options: {
// start_url: '/', // start_url: '/',
name: 'images', name: 'images',
path: `${__dirname}/src/images` path: `${__dirname.toString()}/src/images`
} }
}, },
'gatsby-transformer-sharp', 'gatsby-transformer-sharp',
@@ -47,7 +47,7 @@ const ipfsConfig = [
options: { options: {
start_url: '__GATSBY_IPFS_PATH_PREFIX__', start_url: '__GATSBY_IPFS_PATH_PREFIX__',
name: 'images', name: 'images',
path: `${__dirname}/src/images` path: `${__dirname.toString()}/src/images`
} }
}, },
'gatsby-transformer-sharp', 'gatsby-transformer-sharp',
+2963 -2023
View File
File diff suppressed because it is too large Load Diff
+11 -6
View File
@@ -32,19 +32,24 @@
"gatsby-source-filesystem": "^2.3.8", "gatsby-source-filesystem": "^2.3.8",
"gatsby-transformer-sharp": "2.7.0", "gatsby-transformer-sharp": "2.7.0",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"qrcode.react": "^1.0.0", "qrcode.react": "^1.0.1",
"react": "^16.12.0", "react": "^16.12.0",
"react-dom": "^16.12.0", "react-dom": "^16.12.0",
"react-helmet": "^6.0.0", "react-helmet": "^6.0.0",
"react-jdenticon": "0.0.8", "react-jdenticon": "0.0.8",
"react-qr-reader": "^2.2.1", "react-qr-reader": "^2.2.1",
"react-redux": "^7.2.0" "react-redux": "^7.2.2"
}, },
"devDependencies": { "devDependencies": {
"husky": "^4.2.5", "eslint": "^7.17.0",
"prettier": "2.0.5", "eslint-config-prettier": "^7.1.0",
"semantic-release": "^17.3.0", "eslint-config-standard": "^16.0.2",
"standard": "^14.3.4" "eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-standard": "^5.0.0",
"husky": "^4.3.6",
"prettier": "2.2.1",
"semantic-release": "^17.3.1",
"standard": "^16.0.3"
}, },
"keywords": [ "keywords": [
"gatsby", "gatsby",
+35 -36
View File
@@ -4,10 +4,7 @@ import { Row, Col, Box, Inputs, Button } from 'adminlte-2-react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
// import BchWallet from 'minimal-slp-wallet' // import BchWallet from 'minimal-slp-wallet'
const BchWallet = const BchWallet = typeof window !== 'undefined' ? window.SlpWallet : null
typeof window !== 'undefined'
? window.SlpWallet
: null
const { Text, Select } = Inputs const { Text, Select } = Inputs
@@ -50,39 +47,41 @@ class Servers extends React.Component {
<Box className='border-none'> <Box className='border-none'>
<Row> <Row>
<Col xs={12}> <Col xs={12}>
{_this.state.showAddField ? ( {_this.state.showAddField
<Text ? (
id='newServer' <Text
name='newServer' id='newServer'
placeholder='Add New Server url' name='newServer'
label='Add New Server Url' placeholder='Add New Server url'
labelPosition='above' label='Add New Server Url'
onChange={_this.handleUpdate} labelPosition='above'
value={_this.state.newServer} onChange={_this.handleUpdate}
buttonRight={ value={_this.state.newServer}
<Button buttonRight={
text={_this.state.newServer ? ' ADD ' : 'CLOSE'} <Button
type='primary' text={_this.state.newServer ? ' ADD ' : 'CLOSE'}
onClick={_this.handleNewServerUrl} type='primary'
/> onClick={_this.handleNewServerUrl}
/>
} }
/> />
) : ( )
<Select : (
name='selectedServer' <Select
label='Select Server Url' name='selectedServer'
labelPosition='above' label='Select Server Url'
options={_this.state.selectOptions} labelPosition='above'
value={_this.state.selectedServer} options={_this.state.selectOptions}
onChange={_this.handleUpdate} value={_this.state.selectedServer}
buttonRight={ onChange={_this.handleUpdate}
<Button buttonRight={
icon='fa-plus' <Button
onClick={_this.handleTextField} icon='fa-plus'
/> onClick={_this.handleTextField}
/>
} }
/> />
)} )}
</Col> </Col>
<Col sm={12} /> <Col sm={12} />
</Row> </Row>
@@ -295,7 +294,7 @@ class Servers extends React.Component {
let currentRate let currentRate
if (bchjs.restURL.includes('abc.fullstack')) { if (bchjs.restURL.includes('abc.fullstack')) {
currentRate = await bchjs.Price.getBchaUsd() * 100 currentRate = (await bchjs.Price.getBchaUsd()) * 100
} else { } else {
// BCHN price. // BCHN price.
currentRate = (await bchjs.Price.getUsd()) * 100 currentRate = (await bchjs.Price.getUsd()) * 100
+22 -20
View File
@@ -17,26 +17,28 @@ class SendReceive extends React.Component {
render () { render () {
return ( return (
<> <>
{_this.props.walletInfo.mnemonic ? ( {_this.props.walletInfo.mnemonic
<Content> ? (
<Receive walletInfo={_this.props.walletInfo} /> <Content>
<Send <Receive walletInfo={_this.props.walletInfo} />
updateBalance={_this.props.updateBalance} <Send
bchWallet={_this.props.bchWallet} updateBalance={_this.props.updateBalance}
currentRate={_this.props.currentRate} bchWallet={_this.props.bchWallet}
/> currentRate={_this.props.currentRate}
</Content> />
) : ( </Content>
<Content> )
<Box padding='true' className='container-nofound'> : (
<Row> <Content>
<Col xs={12}> <Box padding='true' className='container-nofound'>
<em>You need to create or import a wallet first</em> <Row>
</Col> <Col xs={12}>
</Row> <em>You need to create or import a wallet first</em>
</Box> </Col>
</Content> </Row>
)} </Box>
</Content>
)}
</> </>
) )
} }
@@ -5,7 +5,7 @@ import copy from 'copy-to-clipboard'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
var QRCode = require('qrcode.react') const QRCode = require('qrcode.react')
let _this let _this
class Receive extends React.Component { class Receive extends React.Component {
+14 -13
View File
@@ -94,20 +94,24 @@ class Send extends React.Component {
<p> <p>
{_this.state.sendCurrency === 'BCH' {_this.state.sendCurrency === 'BCH'
? `USD: ${( ? `USD: ${(
_this.state.amountSat * _this.state.amountSat *
(_this.props.currentRate / 100) (_this.props.currentRate / 100)
).toFixed(2)}` ).toFixed(2)}`
: `BCH: ${( : `BCH: ${(
_this.state.amountSat / _this.state.amountSat /
(_this.props.currentRate / 100) (_this.props.currentRate / 100)
).toFixed(8)}`} ).toFixed(8)}`}
</p> </p>
</div> </div>
<Button <Button
text='Send' text='Send'
type='primary' type='primary'
className='btn-lg' className='btn-lg'
onClick={_this.state.sendMax ? _this.handleSendAll : _this.handleSend} onClick={
_this.state.sendMax
? _this.handleSendAll
: _this.handleSend
}
/> />
</Box> </Box>
</Col> </Col>
@@ -220,9 +224,7 @@ class Send extends React.Component {
// Get total of satoshis fron the bch utxos // Get total of satoshis fron the bch utxos
let totalAmount = 0 let totalAmount = 0
utxos.map(val => { utxos.map(val => (totalAmount += val.satoshis))
totalAmount += val.satoshis
})
// Convert satoshis to bch // Convert satoshis to bch
let amountSat = totalAmount / 100000000 let amountSat = totalAmount / 100000000
@@ -236,7 +238,6 @@ class Send extends React.Component {
_this.setState({ _this.setState({
amountSat: amountSat amountSat: amountSat
}) })
} catch (error) { } catch (error) {
console.error(error) console.error(error)
@@ -288,7 +289,7 @@ class Send extends React.Component {
let currentRate let currentRate
if (bchjs.restURL.includes('abc.fullstack')) { if (bchjs.restURL.includes('abc.fullstack')) {
currentRate = await bchjs.Price.getBchaUsd() * 100 currentRate = (await bchjs.Price.getBchaUsd()) * 100
} else { } else {
// BCHN price. // BCHN price.
currentRate = (await bchjs.Price.getUsd()) * 100 currentRate = (await bchjs.Price.getUsd()) * 100
@@ -369,7 +370,7 @@ class Send extends React.Component {
let currentRate let currentRate
if (bchjs.restURL.includes('abc.fullstack')) { if (bchjs.restURL.includes('abc.fullstack')) {
currentRate = await bchjs.Price.getBchaUsd() * 100 currentRate = (await bchjs.Price.getBchaUsd()) * 100
} else { } else {
// BCHN price. // BCHN price.
currentRate = (await bchjs.Price.getUsd()) * 100 currentRate = (await bchjs.Price.getUsd()) * 100
+42 -45
View File
@@ -37,19 +37,13 @@ class Tokens extends React.Component {
className='btn-md ml-1 mt-1 mb-1' className='btn-md ml-1 mt-1 mb-1'
onClick={() => _this.handleGetTokens(true)} onClick={() => _this.handleGetTokens(true)}
/> />
{_this.state.txId && {_this.state.txId && (
<div className='txIdContainer'> <div className='txIdContainer'>
<button <button onClick={() => _this.setState({ txId: null })}>
onClick={() => _this.setState({ txId: null })}
>
&times; &times;
</button> </button>
<Col xs={12} className='text-center mt-1'> <Col xs={12} className='text-center mt-1'>
<Box <Box title='Transaction ID' type='primary' className='p-0'>
title='Transaction ID'
type='primary'
className='p-0'
>
<a <a
target='_blank' target='_blank'
rel='noopener noreferrer' rel='noopener noreferrer'
@@ -59,7 +53,8 @@ class Tokens extends React.Component {
</a> </a>
</Box> </Box>
</Col> </Col>
</div>} </div>
)}
{_this.state.showForm && ( {_this.state.showForm && (
<SendTokens <SendTokens
bchWallet={_this.props.bchWallet} bchWallet={_this.props.bchWallet}
@@ -74,43 +69,45 @@ class Tokens extends React.Component {
setTxId={_this.setTxId} setTxId={_this.setTxId}
/> />
)} )}
{_this.state.inFetch ? ( {_this.state.inFetch
<div className='spinner'> ? (
<img alt='Loading...' src={Spinner} width={100} /> <div className='spinner'>
</div> <img alt='Loading...' src={Spinner} width={100} />
) : ( </div>
<Content> )
{_this.state.errMsg && ( : (
<Box padding='true' className='container-nofound'> <Content>
<Row> {_this.state.errMsg && (
<Col xs={12}> <Box padding='true' className='container-nofound'>
<em>{_this.state.errMsg}</em> <Row>
</Col> <Col xs={12}>
</Row> <em>{_this.state.errMsg}</em>
</Box> </Col>
)} </Row>
</Box>
)}
{_this.state.tokens.length > 0 && ( {_this.state.tokens.length > 0 && (
<> <>
<Row> <Row>
{_this.state.tokens.map((val, i) => { {_this.state.tokens.map((val, i) => {
return ( return (
<Col sm={4} key={`token-${i}`}> <Col sm={4} key={`token-${i}`}>
<TokenCard <TokenCard
key={`token-${i}`} key={`token-${i}`}
id={`token-${i}`} id={`token-${i}`}
token={val} token={val}
showToken={_this.showToken} showToken={_this.showToken}
selectToken={_this.selectToken} selectToken={_this.selectToken}
/> />
</Col> </Col>
) )
})} })}
</Row> </Row>
</> </>
)}
</Content>
)} )}
</Content>
)}
<TokenModal <TokenModal
token={ token={
_this.state.selectedTokenToView _this.state.selectedTokenToView
@@ -149,7 +149,7 @@ class TokenModal extends React.Component {
// copy info to clipboard // copy info to clipboard
copyToClipBoard (key) { copyToClipBoard (key) {
const val = _this.props.token[key] const val = _this.props.token[key]
var textArea = document.createElement('textarea') const textArea = document.createElement('textarea')
textArea.value = val // copyText.textContent; textArea.value = val // copyText.textContent;
document.body.appendChild(textArea) document.body.appendChild(textArea)
textArea.select() textArea.select()
+1 -1
View File
@@ -30,7 +30,7 @@ class InfoWallets extends React.Component {
supporting Bitcoin Cash (BCH) and SLP tokens. Web wallets supporting Bitcoin Cash (BCH) and SLP tokens. Web wallets
offer user convenience, by they are inherently insecure.{' '} offer user convenience, by they are inherently insecure.{' '}
<b>Storing large amounts of money on a web wallet is not <b>Storing large amounts of money on a web wallet is not
recommended! recommended!
</b> </b>
</p> </p>
</Col> </Col>
@@ -189,7 +189,7 @@ class WalletInfo extends React.Component {
// copy info to clipboard // copy info to clipboard
copyToClipBoard (key) { copyToClipBoard (key) {
const val = _this.state[key] const val = _this.state[key]
var textArea = document.createElement('textarea') const textArea = document.createElement('textarea')
textArea.value = val // copyText.textContent; textArea.value = val // copyText.textContent;
document.body.appendChild(textArea) document.body.appendChild(textArea)
textArea.select() textArea.select()
+1 -1
View File
@@ -35,7 +35,7 @@ export default function HTML (props) {
flexDirection: 'column' flexDirection: 'column'
}} }}
><img src='https://i.imgur.com/8n8PYAi.gif' alt='' width='250' /> ><img src='https://i.imgur.com/8n8PYAi.gif' alt='' width='250' />
Loading... Loading...
</div> </div>
{/* minimal-slp-wallet */} {/* minimal-slp-wallet */}