Skip to content

Commit

Permalink
fixup! fixup! fixup! Use ScrollView in Modal and Table (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkudrna committed Jun 19, 2020
1 parent d6a8c3f commit 25e1dcc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/lib/components/ui/Modal/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Modal extends React.Component {
<ScrollView
customStartShadowStyle={this.props.scrollViewStartShadowStyle}
customEndShadowStyle={this.props.scrollViewEndShadowStyle}
shadowSize="16px"
shadowSize={this.props.scrollViewShadowSize}
>
{content}
</ScrollView>
Expand Down Expand Up @@ -178,6 +178,7 @@ Modal.defaultProps = {
scrollViewEndShadowStyle: {
background: 'radial-gradient(farthest-side at center bottom, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)',
},
scrollViewShadowSize: '16px',
scrollViewStartShadowStyle: {
background: 'radial-gradient(farthest-side at center top, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)',
},
Expand All @@ -202,6 +203,7 @@ Modal.propTypes = {
background: PropTypes.string,
boxShadow: PropTypes.string,
}),
scrollViewShadowSize: PropTypes.string,
scrollViewStartShadowStyle: PropTypes.shape({
background: PropTypes.string,
boxShadow: PropTypes.string,
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/ui/Modal/__tests__/Modal.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('rendering', () => {
disableBodyScrolling
id="custom-id"
scrollViewEndShadow={{ background: 'none' }}
scrollViewShadowSize="30px"
scrollViewStartShadow={{ background: 'none' }}
size="small"
title="Modal title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ exports[`rendering renders correctly with all props except translations 1`] = `
"background": "radial-gradient(farthest-side at center bottom, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
}
}
scrollViewShadowSize="16px"
scrollViewStartShadow={
Object {
"background": "none",
Expand Down Expand Up @@ -332,6 +333,7 @@ exports[`rendering renders correctly with all props except translations and with
"background": "none",
}
}
scrollViewShadowSize="30px"
scrollViewStartShadow={
Object {
"background": "none",
Expand Down Expand Up @@ -368,6 +370,7 @@ exports[`rendering renders correctly with all props except translations and with
"background": "radial-gradient(farthest-side at center bottom, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
}
}
scrollViewShadowSize="30px"
scrollViewStartShadow={
Object {
"background": "none",
Expand Down Expand Up @@ -431,7 +434,7 @@ exports[`rendering renders correctly with all props except translations and with
"background": "radial-gradient(farthest-side at center top, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
}
}
shadowSize="16px"
shadowSize="30px"
translations={null}
>
<ScrollView
Expand Down Expand Up @@ -460,7 +463,7 @@ exports[`rendering renders correctly with all props except translations and with
"red": 255,
}
}
shadowSize="16px"
shadowSize="30px"
translations={
Object {
"next": "Next",
Expand All @@ -475,7 +478,7 @@ exports[`rendering renders correctly with all props except translations and with
"--rui-local-arrow-color": "inherit",
"--rui-local-end-shadow-background": "radial-gradient(farthest-side at center bottom, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
"--rui-local-end-shadow-box-shadow": "none",
"--rui-local-shadow-height": "16px",
"--rui-local-shadow-height": "30px",
"--rui-local-shadow-width": "auto",
"--rui-local-start-shadow-background": "radial-gradient(farthest-side at center top, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
"--rui-local-start-shadow-box-shadow": "none",
Expand Down Expand Up @@ -659,6 +662,7 @@ exports[`rendering renders correctly with mandatory props only 1`] = `
"background": "radial-gradient(farthest-side at center bottom, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
}
}
scrollViewShadowSize="16px"
scrollViewStartShadowStyle={
Object {
"background": "radial-gradient(farthest-side at center top, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
Expand Down Expand Up @@ -818,6 +822,7 @@ exports[`rendering renders correctly with portal id 1`] = `
"background": "radial-gradient(farthest-side at center bottom, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
}
}
scrollViewShadowSize="16px"
scrollViewStartShadowStyle={
Object {
"background": "radial-gradient(farthest-side at center top, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
Expand Down Expand Up @@ -1047,6 +1052,7 @@ exports[`rendering renders correctly with translations 1`] = `
"background": "radial-gradient(farthest-side at center bottom, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
}
}
scrollViewShadowSize="16px"
scrollViewStartShadowStyle={
Object {
"background": "radial-gradient(farthest-side at center top, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.02) 85%, rgba(0, 0, 0, 0) 100%)",
Expand Down

0 comments on commit 25e1dcc

Please sign in to comment.