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) {
}
}, [active])
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>
</div>
)
......
......@@ -71,6 +71,7 @@ function Fixture() {
defaultOutputAddress={optionsToAddressMap[defaultOutput]}
defaultOutputAmount={defaultOutputAmount}
tokenList={tokens}
onConnectWallet={() => console.log('onConnectWallet')} // this handler is included as a test of functionality, but only logs
/>
)
}
......
import { Trans } from '@lingui/macro'
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'
interface WalletProps {
......@@ -9,17 +10,15 @@ interface WalletProps {
onClick?: () => void
}
const ClickableRow = styled(Row)<{ onClick?: unknown }>`
cursor: ${({ onClick }) => onClick && 'pointer'};
`
export default function Wallet({ disabled, onClick }: WalletProps) {
return disabled ? (
<ThemedText.Caption color="secondary">
<ClickableRow gap={0.5} onClick={onClick}>
<TextButton disabled={!onClick} onClick={onClick} color="secondary" style={{ filter: 'none' }}>
<ThemedText.Caption>
<Row gap={0.5}>
<WalletIcon />
<Trans>Connect your wallet</Trans>
</ClickableRow>
</Row>
</ThemedText.Caption>
</TextButton>
) : 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