Skip to content

Commit

Permalink
DialogInnerContentWrapper full height if footerContent exists (#1471)
Browse files Browse the repository at this point in the history
* DialogInnerContentWrapper full height if footerContent exists

* changelog

* only add overflow css if footerContent
  • Loading branch information
pcln-james authored Mar 6, 2024
1 parent 7ce77e7 commit 9823528
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "pcln-design-system",
"comment": "DialogInnerContentWrapper full height if footer exists",
"type": "patch"
}
],
"packageName": "pcln-design-system"
}
11 changes: 9 additions & 2 deletions packages/core/src/Dialog/Dialog.styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,20 @@ const DialogContentWrapper = styled(motion.div)`
? 'none'
: themeGet(`borderRadii.${props.borderRadius}`)(props)};
box-shadow: ${(props: DialogProps) => themeGet('shadows.overlay-lg')(props)};
overflow: ${(props: DialogProps) => (props.sheet ? 'scroll' : 'visible')};
${(props) =>
props.hasFooterContent &&
`
overflow: ${props.sheet ? 'scroll' : 'visible'};
`}
`

const DialogInnerContentWrapper = styled.div`
position: relative;
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto 1fr auto;
height: 100%;
${(props) => props.hasFooterContent && `height: 100%;`}
${overflowX}
${overflowY}
Expand Down Expand Up @@ -197,6 +202,7 @@ export const DialogContent = ({
fullWidth={fullWidth}
borderRadius={borderRadius}
zIndex={zIndex}
hasFooterContent={footerContent}
{...(sheet ? animationStyles.sheet : animationStyles.default)}
>
{showCloseButton && (
Expand All @@ -213,6 +219,7 @@ export const DialogContent = ({
overflowX={overflowX}
overflowY={overflowY}
sheet={sheet}
hasFooterContent={footerContent}
hugColor={hugColor}
size={size}
borderRadius={borderRadius}
Expand Down

0 comments on commit 9823528

Please sign in to comment.