Skip to content

Commit

Permalink
add connect button to page if its not already being displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
KillariDev committed Jul 8, 2024
1 parent d6ddab8 commit f333e98
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions app/ts/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@ import { Signal, useComputed, useSignal } from '@preact/signals'
import { NETWORKS, findNetworkBySimulationRelayEndpoint, getSupportedNetworksNamesAndIds } from '../constants.js'
import { ProviderStore } from '../library/provider.js'
import { EthereumAddress } from '../types/ethereumTypes.js'
import { AppSettings, serialize } from '../types/types.js'
import { AppSettings, BlockInfo, Bundle, serialize, Signers } from '../types/types.js'
import { Blockie } from './Blockie.js'
import { SettingsIcon, SettingsModal } from './Settings.js'
import { Button } from './Button.js'
import { importFromInterceptor } from './Import.js'

export const Navbar = ({
provider,
appSettings
appSettings,
blockInfo,
bundle,
signers
}: {
provider: Signal<ProviderStore | undefined>,
appSettings: Signal<AppSettings>
blockInfo: Signal<BlockInfo>,
appSettings: Signal<AppSettings>,
bundle: Signal<Bundle | undefined>,
signers: Signal<Signers>,
}) => {
const switchNetwork = async (e: Event) => {
const elm = e.target as HTMLSelectElement
Expand Down Expand Up @@ -54,10 +62,12 @@ export const Navbar = ({
</div >
<Blockie address={walletAddress} scale={blockieScale} />
</>
) : (
<>
<p className='w-max'>No Wallet Connected</p>
</>
) : (!provider.value && bundle.value ? <p className='w-max'> No Wallet Connected </p> :
<div className='w-max'>
<Button onClick={() => importFromInterceptor(bundle, provider, blockInfo, appSettings, signers)} >
Connect Wallet
</Button>
</div>
)}
<button class='hover:rotate-45 duration-200 ml-2' onClick={() => (showSettings.value = true)}>
<SettingsIcon />
Expand Down

0 comments on commit f333e98

Please sign in to comment.