Syncing with upstream, fixing merge conflicts

This commit is contained in:
Chris Troutner
2025-03-15 09:01:09 -07:00
4 changed files with 47 additions and 71 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ function GetBalance (props) {
<Col className='text-break' style={{ textAlign: 'center' }}>
<Form>
<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.Group>
+1 -1
View File
@@ -28,7 +28,7 @@ function AppBody (props) {
return (
<>
<Routes>
<Route path='/' element={<GetBalance wallet={appData.wallet} />} />
<Route path='/' element={<NftsForSale appData={appData} />} />} />
<Route path='/balance' element={<GetBalance wallet={appData.wallet} />} />
<Route path='/bch' element={<BchSend appData={appData} />} />
<Route path='/wallet' element={<Wallet appData={appData} />} />
+30 -42
View File
@@ -3,25 +3,25 @@
*/
// Global npm libraries
import React, { useEffect, useState } from 'react'
import React, { useEffect } from 'react'
import { Container, Row, Col } from 'react-bootstrap'
// Local libraries
import config from '../../config'
import Memo from './get-cid'
// import Memo from './get-cid'
function Footer (props) {
const [ipfsCid, setIpfsCid] = useState(config.ipfsCid)
// const [ipfsCid, setIpfsCid] = useState(config.ipfsCid)
const wallet = props.appData.wallet
// Retrieve the most up-to-date CID for the app on Filecoin from the BCH blockchain.
useEffect(() => {
async function fetchData () {
try {
const hash = await getUpdatedUrl(wallet)
if (hash) {
setIpfsCid(hash)
}
// const hash = await getUpdatedUrl(wallet)
// if (hash) {
// setIpfsCid(hash)
// }
} catch (err) {
console.error('Error trying to retrieve Filecoin CID for the app from the BCH blockchain.')
}
@@ -32,56 +32,44 @@ function Footer (props) {
return (
<Container style={{ backgroundColor: '#ddd' }}>
<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>
<h6>Source Code</h6>
<ul>
<li>
<a href={config.ghRepo} target='_blank' rel='noreferrer'>GitHub</a>
</li>
<li>
<a href={config.radicleUrl} target='_blank' rel='noreferrer'>Radicle</a>
</li>
</ul>
</Col>
<Col />
</Row>
</Container>
)
}
async function getUpdatedUrl (wallet) {
try {
// Exit if the wallet is not initialized.
if (!wallet) return
// async function getUpdatedUrl (wallet) {
// try {
// // Exit if the wallet is not initialized.
// if (!wallet) return
// Initialize the memo library for retrieving data from the BCH blockchain.
const memo = new Memo({ bchAddr: config.appBchAddr })
await memo.initialize(wallet)
const hash = await memo.findHash()
// // Initialize the memo library for retrieving data from the BCH blockchain.
// const memo = new Memo({ bchAddr: config.appBchAddr })
// await memo.initialize(wallet)
// const hash = await memo.findHash()
if (!hash) {
console.error(
`Could not find IPFS hash in transactions for address ${config.appBchAddr}`
)
return false
}
// console.log(`latest IPFS hash: ${hash}`)
// if (!hash) {
// console.error(
// `Could not find IPFS hash in transactions for address ${config.appBchAddr}`
// )
// return false
// }
// // console.log(`latest IPFS hash: ${hash}`)
return hash
} catch (err) {
console.log('Error in getUpdatedUrl(): ', err)
}
}
// return hash
// } catch (err) {
// console.log('Error in getUpdatedUrl(): ', err)
// }
// }
export default Footer
+15 -27
View File
@@ -37,22 +37,15 @@ function NavMenu (props) {
<Navbar.Toggle aria-controls='responsive-navbar-nav' />
<Navbar.Collapse id='responsive-navbar-nav'>
<Nav className='mr-auto'>
<NavLink
className={currentPath === '/nfts-for-sale' ? 'nav-link-active' : 'nav-link-inactive'}
className={(currentPath === '/nfts-for-sale' || currentPath === '/') ? 'nav-link-active' : 'nav-link-inactive'}
to='/nfts-for-sale'
onClick={handleClickEvent}
>
NFTs for Sale
</NavLink>
<NavLink
className={(currentPath === '/balance' || currentPath === '/') ? 'nav-link-active' : 'nav-link-inactive'}
to='/balance'
onClick={handleClickEvent}
>
Check Balance
</NavLink>
<NavLink
className={(currentPath === '/bch') ? 'nav-link-active' : 'nav-link-inactive'}
to='/bch'
@@ -60,6 +53,15 @@ function NavMenu (props) {
>
BCH
</NavLink>
<NavLink
className={currentPath === '/slp-tokens' ? 'nav-link-active' : 'nav-link-inactive'}
to='/slp-tokens'
onClick={handleClickEvent}
>
Tokens
</NavLink>
<NavLink
className={currentPath === '/wallet' ? 'nav-link-active' : 'nav-link-inactive'}
to='/wallet'
@@ -70,27 +72,13 @@ function NavMenu (props) {
</NavLink>
<NavLink
className={currentPath === '/slp-tokens' ? 'nav-link-active' : 'nav-link-inactive'}
to='/slp-tokens'
className={(currentPath === '/balance') ? 'nav-link-active' : 'nav-link-inactive'}
to='/balance'
onClick={handleClickEvent}
>
Tokens
</NavLink>
<NavLink
className={currentPath === '/Placeholder2' ? 'nav-link-active' : 'nav-link-inactive'}
to='/Placeholder2'
onClick={handleClickEvent}
>
Placeholder2
</NavLink>
<NavLink
className={currentPath === '/placeholder3' ? 'nav-link-active' : 'nav-link-inactive'}
to='/placeholder3'
onClick={handleClickEvent}
>
Placeholder 3
Check Balance
</NavLink>
</Nav>
</Navbar.Collapse>
</Navbar>