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