Skip to content

Commit ef1004c

Browse files
authored
feat(HTL-90706): add borderRadius (#1319)
1 parent cce6970 commit ef1004c

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "pcln-modal",
5+
"comment": "add borderRadius prop for modal",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "pcln-modal"
10+
}

packages/modal/src/Modal.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ const Dialog = styled(DialogContent)`
5353
margin-left: auto;
5454
margin-right: auto;
5555
box-shadow: ${(props) => props.theme.shadows['overlay-xl']};
56-
border-radius: ${themeGet('borderRadii.xl')};
56+
border-radius: ${({ borderRadius }) => themeGet(`borderRadii.${borderRadius}`)};
57+
overflow-y: auto;
5758
&:focus {
5859
outline: none;
5960
}
@@ -139,6 +140,7 @@ const Modal = ({
139140
ariaLabel,
140141
ariaLabelledBy,
141142
bg,
143+
borderRadius,
142144
children,
143145
className,
144146
dialogAnimation,
@@ -180,6 +182,7 @@ const Modal = ({
180182
<Dialog
181183
width={fullScreen ? '100vw' : width}
182184
bg={bg}
185+
borderRadius={borderRadius}
183186
height={dialogHeight}
184187
transitionstate={state}
185188
className={className}
@@ -194,7 +197,7 @@ const Modal = ({
194197
<DialogInnerWrapper flexDirection='column'>
195198
{header && <HeaderWrapper>{header}</HeaderWrapper>}
196199
<ContentWrapper
197-
borderRadius='xl'
200+
borderRadius={borderRadius}
198201
p={imgMode ? 0 : 16}
199202
header={header}
200203
enableoverflow={enableOverflow}
@@ -216,6 +219,7 @@ const Modal = ({
216219

217220
Modal.defaultProps = {
218221
bg: 'white',
222+
borderRadius: 'xl',
219223
dialogAnimation: null,
220224
disableCloseButton: false,
221225
enableOverflow: false,

packages/modal/src/ModalHeader.jsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ const StyledCloseButton = styled(CloseButton)`
2323
`
2424

2525
const ModalHeader = ({ bg, color, onClose, textStyle, title, ...props }) => (
26-
<Flex
27-
align='center'
28-
alignItems='center'
29-
color={color}
30-
bg={bg}
31-
borderRadius='xl'
32-
height='40px'
33-
rounded='top'
34-
{...props}
35-
>
26+
<Flex align='center' alignItems='center' color={color} bg={bg} height='40px' {...props}>
3627
{title && <Title textStyle={textStyle}>{title}</Title>}
3728
{onClose && <StyledCloseButton onClick={onClose} ml='auto' />}
3829
</Flex>

packages/modal/src/__snapshots__/Headers.spec.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ exports[`ModalHeader render 1`] = `
44
.c1 {
55
background-color: #0a0;
66
color: #fff;
7-
border-radius: 16px 16px 0 0;
87
height: 40px;
98
padding-left: 16px;
109
padding-right: 16px;

0 commit comments

Comments
 (0)