Skip to content

Commit

Permalink
update build website
Browse files Browse the repository at this point in the history
  • Loading branch information
chendatony31 committed Mar 7, 2022
1 parent 9fddadf commit 76b0f06
Show file tree
Hide file tree
Showing 5 changed files with 6,075 additions and 94 deletions.
66 changes: 33 additions & 33 deletions components/chain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
export default function Chain({ chain }) {
const router = useRouter()

const [ account, setAccount ] = useState(null)
const [account, setAccount] = useState(null)

useEffect(() => {
const accountConfigure = () => {
Expand All @@ -38,11 +38,11 @@ export default function Chain({ chain }) {
}, [])

const toHex = (num) => {
return '0x'+num.toString(16)
return '0x' + num.toString(16)
}

const addToNetwork = () => {
if(!(account && account.address)) {
if (!(account && account.address)) {
stores.dispatcher.dispatch({ type: TRY_CONNECT_WALLET })
return
}
Expand All @@ -56,27 +56,27 @@ export default function Chain({ chain }) {
decimals: chain.nativeCurrency.decimals,
},
rpcUrls: chain.rpc,
blockExplorerUrls: [ ((chain.explorers && chain.explorers.length > 0 && chain.explorers[0].url) ? chain.explorers[0].url : chain.infoURL) ]
blockExplorerUrls: [((chain.explorers && chain.explorers.length > 0 && chain.explorers[0].url) ? chain.explorers[0].url : chain.infoURL)]
}

window.web3.eth.getAccounts((error, accounts) => {
window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [params, accounts[0]],
})
.then((result) => {
console.log(result)
})
.catch((error) => {
stores.emitter.emit(ERROR, error.message ? error.message : error)
console.log(error)
});
.then((result) => {
console.log(result)
})
.catch((error) => {
stores.emitter.emit(ERROR, error.message ? error.message : error)
console.log(error)
});
})
}

const renderProviderText = () => {

if(account && account.address) {
if (account && account.address) {
const providerTextList = {
Metamask: 'Add to Metamask',
imToken: 'Add to imToken',
Expand All @@ -89,49 +89,49 @@ export default function Chain({ chain }) {

}

if(!chain) {
if (!chain) {
return <div></div>
}

return (
<Paper elevation={ 1 } className={ classes.chainContainer } key={ chain.chainId }>
<div className={ classes.chainNameContainer }>
<Paper elevation={1} className={classes.chainContainer} key={chain.chainId}>
<div className={classes.chainNameContainer}>
<img
// src='/connectors/icn-asd.svg'
// onError={e => {
// e.target.onerror = null;
// e.target.src = "/chains/unknown-logo.png";
// }}
src="/NetworkList/chains/unknown-logo.png"
width={ 28 }
height={ 28 }
className={ classes.avatar }
src="/chains/unknown-logo.png"
width={28}
height={28}
className={classes.avatar}
/>
<Tooltip title={ chain.name }>
<Typography variant='h3' className={ classes.name } noWrap>
<a href={ chain.infoURL } target="_blank" rel="noreferrer">
{ chain.name }
<Tooltip title={chain.name}>
<Typography variant='h3' className={classes.name} noWrap>
<a href={chain.infoURL} target="_blank" rel="noreferrer">
{chain.name}
</a>
</Typography>
</Tooltip>
</div>
<div className={ classes.chainInfoContainer }>
<div className={ classes.dataPoint }>
<Typography variant='subtitle1' color='textSecondary' className={ classes.dataPointHeader} >ChainID</Typography>
<Typography variant='h5'>{ chain.chainId }</Typography>
<div className={classes.chainInfoContainer}>
<div className={classes.dataPoint}>
<Typography variant='subtitle1' color='textSecondary' className={classes.dataPointHeader} >ChainID</Typography>
<Typography variant='h5'>{chain.chainId}</Typography>
</div>
<div className={ classes.dataPoint }>
<Typography variant='subtitle1' color='textSecondary' className={ classes.dataPointHeader}>Currency</Typography>
<Typography variant='h5'>{ chain.nativeCurrency ? chain.nativeCurrency.symbol : 'none' }</Typography>
<div className={classes.dataPoint}>
<Typography variant='subtitle1' color='textSecondary' className={classes.dataPointHeader}>Currency</Typography>
<Typography variant='h5'>{chain.nativeCurrency ? chain.nativeCurrency.symbol : 'none'}</Typography>
</div>
</div>
<div className={ classes.addButton }>
<div className={classes.addButton}>
<Button
variant='outlined'
color='primary'
onClick={ addToNetwork }
onClick={addToNetwork}
>
{ renderProviderText() }
{renderProviderText()}
</Button>
</div>
</Paper>
Expand Down
26 changes: 13 additions & 13 deletions components/multichain/multichain.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { getProvider } from '../../utils'

export default function Multichain({ closeMultichain }) {

const [ checked, setChecked ] = useState(false)
const [checked, setChecked] = useState(false)

const navigateToMultichain = () => {
window.open("https://multichain.xyz", "_blank")
window.open("https://www.transit.finance/", "_blank")
}

const handleChange = () => {
Expand Down Expand Up @@ -68,33 +68,33 @@ export default function Multichain({ closeMultichain }) {
});

return (
<Paper elevation={ 1 } className={ classes.chainContainer } key={ 'multichain' } >
<Paper elevation={1} className={classes.chainContainer} key={'multichain'} >
<ThemeProvider theme={theme}>
<div className={ classes.topInfo }>
<img src='/NetworkList/multichain-logo.png' width={ 126 } height={ 126 } className={ classes.avatar } />
<Typography variant='subtitle1' className={ classes.descriptionText} align='center' >Manage over 120 tokens and multi-chain assets with fully supported cross chain transactions.</Typography>
<div className={classes.topInfo}>
<img src='/NetworkList/multichain-logo.png' width={126} height={126} className={classes.avatar} />
<Typography variant='subtitle1' className={classes.descriptionText} align='center' >Manage over 120 tokens and multi-chain assets with fully supported cross chain transactions.</Typography>
<Button
className={ classes.tryButton }
className={classes.tryButton}
variant='contained'
disableElevation
onClick={ navigateToMultichain }
onClick={navigateToMultichain}
color='secondary'
endIcon={<ArrowForwardIcon />}
>
<Typography className={ classes.buttonLabel }>Try out <b>multichain.xyz</b></Typography>
<Typography className={classes.buttonLabel}>Try out <b>Transit.finance</b></Typography>
</Button>
</div>
<div className={ classes.bottomActions }>
<div className={classes.bottomActions}>
<FormControlLabel
control={<Checkbox checked={ checked } onChange={handleChange} name="checked" />}
control={<Checkbox checked={checked} onChange={handleChange} name="checked" />}
label="Don't show again"
/>
<Button
size='small'
onClick={ () => { closeMultichain(checked) } }
onClick={() => { closeMultichain(checked) }}
endIcon={<CloseIcon />}
>
<Typography className={ classes.buttonLabel }>Close</Typography>
<Typography className={classes.buttonLabel}>Close</Typography>
</Button>
</div>
</ThemeProvider>
Expand Down
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
// Use the CDN in production and localhost for development.
assetPrefix: 'https://tp-lab.tokenpocket.pro/NetworkList/',
basePath: '/NetworkList',
// assetPrefix: 'https://tp-lab.tokenpocket.pro/NetworkList/',
basePath: '',
}
Loading

0 comments on commit 76b0f06

Please sign in to comment.