Skip to content

Commit

Permalink
add view chains button
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler committed Apr 4, 2023
1 parent 61fe3ce commit a712847
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
23 changes: 18 additions & 5 deletions app/dapp/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import Restore from 'react-restore'

import link from '../../resources/link'
import Native from '../../resources/Native'

class App extends React.Component {
Expand Down Expand Up @@ -30,10 +31,9 @@ class App extends React.Component {
const sendDapp =
this.store('main.dapps', '0xe8d705c28f65bc3fe10df8b22f9daa265b99d0e1893b2df49fd38120f0410bca') || {}

const isMainnetConnected = () => {
const mainnet = this.store('main.networks.ethereum.1')
return mainnet.on && (mainnet.connection.primary.connected || mainnet.connection.secondary.connected)
}
const mainnet = this.store('main.networks.ethereum.1')
const isMainnetConnected =
mainnet.on && (mainnet.connection.primary.connected || mainnet.connection.secondary.connected)

return (
<div className='splash'>
Expand All @@ -43,10 +43,23 @@ class App extends React.Component {
{!currentView.ready && sendDapp.status === 'failed' ? (
<div className='mainDappLoading'>
<div className='mainDappLoadingText'>
{isMainnetConnected()
{isMainnetConnected
? 'Send dapp failed to load'
: 'Mainnet connection required to resolve ENS'}
</div>
{!isMainnetConnected && (
<div
className='mainDappEnableChains'
onClick={() => {
link.send('tray:action', 'navDash', { view: 'chains', data: {} })
setTimeout(() => {
link.send('frame:close')
}, 100)
}}
>
View Chains
</div>
)}
</div>
) : null}
</div>
Expand Down
22 changes: 22 additions & 0 deletions app/dapp/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,28 @@ body
100%
transform rotate(360deg)

.mainDappEnableChains
height 40px
margin-top 30px
background var(--ghostA)
border-bottom 2px solid var(--ghostZ)
box-shadow 0px 1px 4px var(--ghostX)
border-radius 15px
box-sizing border-box
cursor pointer
display flex
justify-content center
align-items center
font-size 11px
font-weight 400
letter-spacing 1px
text-transform uppercase
padding 1px 20px 0px 21px

.mainDappEnableChains:hover
background var(--ghostB)
color var(--outerspace)

.mainApps
width 600px
height 300px
Expand Down

0 comments on commit a712847

Please sign in to comment.