Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add margin zero to grid and add padding top for modal when img top #425

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ Footer.propTypes = {
bottomItem: PropTypes.node,
/** Footer list className. */
listClassName: PropTypes.string,
isFluid: PropTypes.boolean,
isFluid: PropTypes.bool,
/** Custom component to render at the top of the footer, commonly used for brand logo */
topElement: PropTypes.node,
/** Custom classname for bottomLinks container. */
bottomLinksClassName: PropTypes.string,
/** Flag to display an horizontal line between sections */
sectionDivider: PropTypes.boolean,
sectionDivider: PropTypes.bool,
};

Footer.defaultProps = {
Expand Down
164 changes: 113 additions & 51 deletions lib/Footer/__snapshots__/Footer.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,141 @@ exports[`Footer matches the snapshot 1`] = `ShallowWrapper {}`;

exports[`Footer styles matches the snapshot 1`] = `
Object {
"bottomWrap": Object {
"borderTop": "1px solid #dddddd",
"paddingTop": 24,
"auxContainer": Object {
"@media (min-width: 992px)": Object {
"flexDirection": "row",
"gap": "64px",
},
"alignItems": "center",
"display": "flex",
"flexDirection": "column",
"gap": "24px",
"justifyContent": "center",
},
"buttonMobile": Object {
"marginTop": 16,
"badgesContainer": Object {
"@media (min-width: 576px)": Object {
"flexDirection": "row",
},
"display": "flex",
"flexDirection": "column",
"gap": "16px",
},
"column": Object {
"paddingBottom": 16,
"bottomContainer": Object {
"@media (min-width: 768px)": Object {
"rowGap": "24px",
},
"display": "flex",
"flexDirection": "column",
"rowGap": "16px",
},
"footer": Object {
"bottomLinksContainer": Object {
"@media (min-width: 768px)": Object {
"alignItems": "stretch",
"flexDirection": "row",
},
"columnGap": "24px",
"display": "flex",
"flexDirection": "column",
"justifyContent": "center",
"rowGap": "16px",
},
"bottomSection": Object {
"display": "flex",
"flexDirection": "column",
"rowGap": "40px",
},
"column": Object {
"@media (min-width: 576px)": Object {
"columnGap": "16px",
"flexDirection": "row",
"rowGap": "40px",
},
"@media (min-width: 992px)": Object {
"padding": Array [
32,
0,
32,
],
"columnGap": "24px",
"rowGap": 0,
},
"backgroundColor": "#f5f5f8",
"display": "flex",
"flexDirection": "column",
"flexWrap": "wrap",
},
"copyright": Object {
"& > p": Object {
"margin": 0,
},
"color": "#5A5D7B",
"font": "300 16px/1.5 'OccText', sans-serif",
},
"divider": Object {
"borderTop": "1px solid #EDEDF1",
},
"footer": Object {
"backgroundColor": "#fff",
"borderTop": "1px solid #EDEDF1",
"padding": Array [
24,
"40px",
0,
32,
],
},
"footerWithoutColumns": Object {
"footerContainer": Object {
"@media (min-width: 576px)": Object {
"rowGap": "40px",
},
"@media (min-width: 992px)": Object {
"padding": Array [
0,
0,
32,
],
"rowGap": "48px",
},
"backgroundColor": "#f5f5f8",
"padding": Array [
0,
0,
32,
],
"display": "flex",
"flexDirection": "column",
"rowGap": "24px",
},
"link": Object {
"&:hover, &:focus, &:active": Object {
"color": "#777777",
"&:focus-visible": Object {
"borderRadius": "4px",
"boxShadow": "0 0 0 8px hsl(234 75.4% 12.7% / 0.1)",
"color": "#080D39",
"outline": 0,
},
"&:hover": Object {
"color": "#080D39",
},
"color": "#777777",
"cursor": "pointer",
"color": "#5A5D7B",
"font": "300 16px/1.5 'OccText', sans-serif",
"textDecoration": "none",
"transition": "all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s",
},
"list": Object {
"&:not(:first-child)": Object {
"marginLeft": 16,
"linkDivider": Object {
"@media (min-width: 768px)": Object {
"display": "block",
},
"alignSelf": "stretch",
"backgroundColor": "#6C6F89",
"display": "none",
"margin": Array [
"2px",
0,
],
"width": 1,
},
"listElement": Object {
"&:first-child": Object {
"paddingLeft": 0,
"listContainer": Object {
"@media (min-width: 576px)": Object {
"flexBasis": "calc(50% - 16px)",
},
"&:not(:last-child)": Object {
"&::after": Object {
"content": "\\"|\\"",
"position": "absolute",
"right": -2,
},
"@media (min-width: 992px)": Object {
"flexBasis": "calc(25% - 24px)",
},
"display": "inline-block",
"paddingLeft": 16,
"paddingRight": 16,
"position": "relative",
"flexBasis": "100%",
},
"mobileListElement": Object {
"listElement": Object {
"@media (min-width: 768px)": Object {
"display": "inline-block",
"position": "relative",
},
"display": "block",
"paddingBottom": 8,
"paddingLeft": 0,
"textAlign": "center",
},
"socialMediaContainer": Object {
"columnGap": "4px",
"direction": "row",
"display": "flex",
},
}
`;
Expand Down
2 changes: 1 addition & 1 deletion lib/Grid/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
},
con: {
width: grid.full,
margin: 'auto',
margin: '0 auto',
padding: [0, spacing['size-3']]
},
[`@media (min-width: ${grid.xs}px)`]: {
Expand Down
31 changes: 16 additions & 15 deletions lib/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class Modal extends React.Component {
const { scrollTop, scrollHeight, clientHeight } = e.currentTarget;
if (scrollHeight > clientHeight) {
if (scrollTop > 0) {
this.setState({ headerBorder: true });
this.setState({ headerBorder: true });
} else {
this.setState({ headerBorder: false });
this.setState({ headerBorder: false });
}
if (scrollTop + clientHeight + 1 < scrollHeight) {
this.setState({ footerBorder: true });
this.setState({ footerBorder: true });
} else {
this.setState({ footerBorder: false });
this.setState({ footerBorder: false });
}
} else {
this.setState({ headerBorder: false, footerBorder: false });
Expand Down Expand Up @@ -86,9 +86,9 @@ class Modal extends React.Component {
return (
<div
data-testid={testId}
className={`${classes.overlay} ${
show ? classes.show : classes.hide
}${!onClose ? ` ${classes.noClose}` : ''}`}
className={`${classes.overlay} ${show ? classes.show : classes.hide}${
!onClose ? ` ${classes.noClose}` : ''
}`}
onClick={onClose}
onTransitionEnd={onTransitionEnd}
>
Expand Down Expand Up @@ -122,9 +122,11 @@ class Modal extends React.Component {
justifyContent="end"
alignItems="start"
className={`${classes.header}${
headerBorder ? ` ${classes.headerBorder}` : ''}${
imgTop.img ? ` ${classes.stickyHeader}` : ''}${
imgTop.img && headerBorder ? ` ${classes.solidHeader}` : ''
headerBorder ? ` ${classes.headerBorder}` : ''
}${imgTop.img ? ` ${classes.stickyHeader}` : ''}${
imgTop.img && headerBorder
? ` ${classes.solidHeader}`
: ''
}`}
>
{title && (
Expand All @@ -135,10 +137,7 @@ class Modal extends React.Component {
{onClose && closeButton}
</Flexbox>
) : null}
<div
onScroll={this.onScroll}
className={classes.content}
>
<div onScroll={this.onScroll} className={classes.content}>
{imgTop.img && (
<div
style={{
Expand All @@ -154,7 +153,9 @@ class Modal extends React.Component {
tag="div"
className={`${classes.contentChild}${
!title && !onClose ? ` ${classes.noHeader}` : ''
}${!mainBtn ? ` ${classes.noFooter}` : ''}`}
}${!mainBtn ? ` ${classes.noFooter}` : ''}${
imgTop && imgTop.img ? ` ${classes.imgTopPadding}` : ''
}`}
>
{children}
</Text>
Expand Down
3 changes: 3 additions & 0 deletions lib/Modal/__snapshots__/Modal.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ Object {
"objectFit": "cover",
"width": "100%",
},
"imgTopPadding": Object {
"paddingTop": "24px",
},
"lg": Object {
"width": 820,
},
Expand Down
3 changes: 3 additions & 0 deletions lib/Modal/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,8 @@ export default {
top: spacing.medium,
right: spacing.medium
}
},
imgTopPadding: {
paddingTop: newSpacing['size-5']
}
};
4 changes: 0 additions & 4 deletions lib/Tip/__snapshots__/Tip.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ Object {
"color": "#664a0e",
},
"maxWidth": Object {
"margin": Array [
0,
"auto",
],
"maxWidth": "1200px",
},
"noBorderRadius": Object {
Expand Down