mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex-taker-v2.git
synced 2026-09-21 16:52:01 -07:00
Merge pull request #35 from Permissionless-Software-Foundation/ct-unstable
fix(footer): Removing links slowing down startup
This commit is contained in:
@@ -45,7 +45,7 @@ function GetBalance (props) {
|
|||||||
<Col className='text-break' style={{ textAlign: 'center' }}>
|
<Col className='text-break' style={{ textAlign: 'center' }}>
|
||||||
<Form>
|
<Form>
|
||||||
<Form.Group className='mb-3' controlId='formBasicEmail'>
|
<Form.Group className='mb-3' controlId='formBasicEmail'>
|
||||||
<Form.Label>Enter a BCH address to check the balance.</Form.Label>
|
<Form.Label>Enter any BCH address to query its balance on the blockchain.</Form.Label>
|
||||||
<Form.Control type='text' placeholder='bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d' onChange={e => setTextInput(e.target.value)} />
|
<Form.Control type='text' placeholder='bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d' onChange={e => setTextInput(e.target.value)} />
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Global npm libraries
|
// Global npm libraries
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
import { Container, Row, Col } from 'react-bootstrap'
|
import { Container, Row, Col } from 'react-bootstrap'
|
||||||
|
|
||||||
// Local libraries
|
// Local libraries
|
||||||
import config from '../../config'
|
import config from '../../config'
|
||||||
import Memo from './get-cid'
|
// import Memo from './get-cid'
|
||||||
|
|
||||||
function Footer (props) {
|
function Footer (props) {
|
||||||
const [ipfsCid, setIpfsCid] = useState(config.ipfsCid)
|
// const [ipfsCid, setIpfsCid] = useState(config.ipfsCid)
|
||||||
const wallet = props.appData.wallet
|
const wallet = props.appData.wallet
|
||||||
|
|
||||||
// Retrieve the most up-to-date CID for the app on Filecoin from the BCH blockchain.
|
// Retrieve the most up-to-date CID for the app on Filecoin from the BCH blockchain.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchData () {
|
async function fetchData () {
|
||||||
try {
|
try {
|
||||||
const hash = await getUpdatedUrl(wallet)
|
// const hash = await getUpdatedUrl(wallet)
|
||||||
if (hash) {
|
// if (hash) {
|
||||||
setIpfsCid(hash)
|
// setIpfsCid(hash)
|
||||||
}
|
// }
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error trying to retrieve Filecoin CID for the app from the BCH blockchain.')
|
console.error('Error trying to retrieve Filecoin CID for the app from the BCH blockchain.')
|
||||||
}
|
}
|
||||||
@@ -32,56 +32,44 @@ function Footer (props) {
|
|||||||
return (
|
return (
|
||||||
<Container style={{ backgroundColor: '#ddd' }}>
|
<Container style={{ backgroundColor: '#ddd' }}>
|
||||||
<Row style={{ padding: '25px' }}>
|
<Row style={{ padding: '25px' }}>
|
||||||
<Col>
|
|
||||||
<h6>Site Mirrors</h6>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href={config.ghPagesUrl} target='_blank' rel='noreferrer'>GitHub Pages</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href={`https://${ipfsCid}.ipfs.dweb.link/`} target='_blank' rel='noreferrer'>Filecoin</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</Col>
|
|
||||||
|
|
||||||
<Col>
|
<Col>
|
||||||
<h6>Source Code</h6>
|
<h6>Source Code</h6>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href={config.ghRepo} target='_blank' rel='noreferrer'>GitHub</a>
|
<a href={config.ghRepo} target='_blank' rel='noreferrer'>GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<a href={config.radicleUrl} target='_blank' rel='noreferrer'>Radicle</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
|
<Col />
|
||||||
</Row>
|
</Row>
|
||||||
</Container>
|
</Container>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUpdatedUrl (wallet) {
|
// async function getUpdatedUrl (wallet) {
|
||||||
try {
|
// try {
|
||||||
// Exit if the wallet is not initialized.
|
// // Exit if the wallet is not initialized.
|
||||||
if (!wallet) return
|
// if (!wallet) return
|
||||||
|
|
||||||
// Initialize the memo library for retrieving data from the BCH blockchain.
|
// // Initialize the memo library for retrieving data from the BCH blockchain.
|
||||||
const memo = new Memo({ bchAddr: config.appBchAddr })
|
// const memo = new Memo({ bchAddr: config.appBchAddr })
|
||||||
await memo.initialize(wallet)
|
// await memo.initialize(wallet)
|
||||||
const hash = await memo.findHash()
|
// const hash = await memo.findHash()
|
||||||
|
|
||||||
if (!hash) {
|
// if (!hash) {
|
||||||
console.error(
|
// console.error(
|
||||||
`Could not find IPFS hash in transactions for address ${config.appBchAddr}`
|
// `Could not find IPFS hash in transactions for address ${config.appBchAddr}`
|
||||||
)
|
// )
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
// console.log(`latest IPFS hash: ${hash}`)
|
// // console.log(`latest IPFS hash: ${hash}`)
|
||||||
|
|
||||||
return hash
|
// return hash
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
console.log('Error in getUpdatedUrl(): ', err)
|
// console.log('Error in getUpdatedUrl(): ', err)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
export default Footer
|
export default Footer
|
||||||
|
|||||||
Reference in New Issue
Block a user