Skip to content

Commit

Permalink
fix(Dialog): Entrance transition
Browse files Browse the repository at this point in the history
  • Loading branch information
rppld committed May 15, 2019
1 parent d0c9d0d commit e4e19d0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/components/Dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '../../theme'
import { useLockBodyScroll, usePrevious } from '../../hooks'

const Backdrop = styled.div`
const DialogOverlay = styled.div`
position: fixed;
z-index: 2147483647; /* largest accepted z-index value as integer */
left: 0;
Expand All @@ -38,18 +38,7 @@ const Backdrop = styled.div`
}
`

export function DialogOverlay({ children, ...props }) {
const ref = useRef(null)
useLockBodyScroll(ref)

return (
<div {...props}>
<Backdrop ref={ref}>{children}</Backdrop>
</div>
)
}

const DialogContent = styled.div`
const Content = styled.div`
position: relative;
width: 100%;
background-color: white;
Expand All @@ -63,6 +52,17 @@ const DialogContent = styled.div`
}
`

export function DialogContent({ children, ...props }) {
const ref = useRef(null)
useLockBodyScroll(ref)

return (
<div {...props}>
<Content ref={ref}>{children}</Content>
</div>
)
}

export const DialogHeader = styled.header`
position: relative;
height: ${space[56]};
Expand Down

0 comments on commit e4e19d0

Please sign in to comment.