Fix Popup padding overflow in Provider's UserDetails

This commit is contained in:
apanizo 2018-08-30 17:54:26 +02:00
parent 620b977e9c
commit daa5b22c84
2 changed files with 10 additions and 5 deletions

View File

@ -99,13 +99,13 @@ const Header = openHoc(({
open={open} open={open}
toggle={toggle} toggle={toggle}
> >
{myRef => ( {providerRef => (
<Popper open={open} anchorEl={myRef.current} placement="bottom-end"> <Popper open={open} anchorEl={providerRef.current} placement="bottom-end">
{({ TransitionProps }) => ( {({ TransitionProps }) => (
<Grow <Grow
{...TransitionProps} {...TransitionProps}
> >
<ClickAwayListener onClickAway={toggle} className={classes.details}> <ClickAwayListener onClickAway={toggle}>
<UserDetails <UserDetails
provider={provider} provider={provider}
network={network} network={network}

View File

@ -8,6 +8,7 @@ import Identicon from '~/components/Identicon'
import Col from '~/components/layout/Col' import Col from '~/components/layout/Col'
import Row from '~/components/layout/Row' import Row from '~/components/layout/Row'
import Spacer from '~/components/Spacer' import Spacer from '~/components/Spacer'
import { md } from '~/theme/variables'
import Details from './Details' import Details from './Details'
type Props = { type Props = {
@ -23,6 +24,10 @@ const openIconStyle = {
} }
const styles = () => ({ const styles = () => ({
root: {
backgroundColor: 'white',
padding: md,
},
user: { user: {
alignItems: 'center', alignItems: 'center',
border: '1px solid grey', border: '1px solid grey',
@ -38,7 +43,7 @@ const styles = () => ({
const UserDetails = ({ const UserDetails = ({
provider, connected, network, userAddress, classes, provider, connected, network, userAddress, classes,
}: Props) => ( }: Props) => (
<React.Fragment> <div className={classes.root}>
<Row grow margin="md"> <Row grow margin="md">
<Details provider={provider} connected={connected} network={network} /> <Details provider={provider} connected={connected} network={network} />
<Spacer /> <Spacer />
@ -51,7 +56,7 @@ const UserDetails = ({
<Col align="center" margin="md"> <Col align="center" margin="md">
<Button size="small" variant="raised" color="secondary">DISCONNECT</Button> <Button size="small" variant="raised" color="secondary">DISCONNECT</Button>
</Col> </Col>
</React.Fragment> </div>
) )
export default withStyles(styles)(UserDetails) export default withStyles(styles)(UserDetails)