Commit bca51135 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: connect wallet button (#3324)

* fix: make dialog provider an isolate

* fix: use button for connect wallet

* chore: document esoteric changes
parent 6779c1a0
...@@ -40,7 +40,10 @@ export function Provider({ value, children }: ProviderProps) { ...@@ -40,7 +40,10 @@ export function Provider({ value, children }: ProviderProps) {
} }
}, [active]) }, [active])
return ( return (
<div ref={ref}> <div
ref={ref}
style={{ isolation: 'isolate' }} // creates a new stacking context, preventing the dialog from intercepting non-dialog clicks
>
<Context.Provider value={context}>{children}</Context.Provider> <Context.Provider value={context}>{children}</Context.Provider>
</div> </div>
) )
......
...@@ -71,6 +71,7 @@ function Fixture() { ...@@ -71,6 +71,7 @@ function Fixture() {
defaultOutputAddress={optionsToAddressMap[defaultOutput]} defaultOutputAddress={optionsToAddressMap[defaultOutput]}
defaultOutputAmount={defaultOutputAmount} defaultOutputAmount={defaultOutputAmount}
tokenList={tokens} tokenList={tokens}
onConnectWallet={() => console.log('onConnectWallet')} // this handler is included as a test of functionality, but only logs
/> />
) )
} }
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Wallet as WalletIcon } from 'lib/icons' import { Wallet as WalletIcon } from 'lib/icons'
import styled, { ThemedText } from 'lib/theme' import { ThemedText } from 'lib/theme'
import { TextButton } from './Button'
import Row from './Row' import Row from './Row'
interface WalletProps { interface WalletProps {
...@@ -9,17 +10,15 @@ interface WalletProps { ...@@ -9,17 +10,15 @@ interface WalletProps {
onClick?: () => void onClick?: () => void
} }
const ClickableRow = styled(Row)<{ onClick?: unknown }>`
cursor: ${({ onClick }) => onClick && 'pointer'};
`
export default function Wallet({ disabled, onClick }: WalletProps) { export default function Wallet({ disabled, onClick }: WalletProps) {
return disabled ? ( return disabled ? (
<ThemedText.Caption color="secondary"> <TextButton disabled={!onClick} onClick={onClick} color="secondary" style={{ filter: 'none' }}>
<ClickableRow gap={0.5} onClick={onClick}> <ThemedText.Caption>
<WalletIcon /> <Row gap={0.5}>
<Trans>Connect your wallet</Trans> <WalletIcon />
</ClickableRow> <Trans>Connect your wallet</Trans>
</ThemedText.Caption> </Row>
</ThemedText.Caption>
</TextButton>
) : null ) : null
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment