Skip to content

Commit c20d308

Browse files
Merge pull request #89 from Web-Dev-Path/chore/adjust-section-containers
Normalizing the container use on components
2 parents 70eb021 + 485d052 commit c20d308

14 files changed

+49
-63
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2828
- fixed scroll-x added by the layout container, adjust README
2929
- updated TwoColumn.js component with style props
3030
- updated favicon icon and add OG
31+
- normalized container use on components

components/CardsColumns.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Card from './Card';
2+
import Container from './Container';
23
import styles from '../styles/CardsColumns.module.scss';
34

45
export default function CardsColumns({
@@ -10,7 +11,7 @@ export default function CardsColumns({
1011
linkText,
1112
}) {
1213
return (
13-
<section className={styles.container}>
14+
<Container>
1415
<div className={styles.inner__content}>
1516
{titles.map((title, index) => {
1617
return (
@@ -26,6 +27,6 @@ export default function CardsColumns({
2627
);
2728
})}
2829
</div>
29-
</section>
30+
</Container>
3031
);
3132
}

components/Container.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import containerStyles from '../styles/Container.module.scss';
22

3-
export default function Container({ className, children }) {
3+
export default function Container({ className, children, styles }) {
44
return (
55
<div
66
className={`${containerStyles.container} ${className ? className : ''}`}
7+
style={styles}
78
>
89
{children}
910
</div>

components/Footer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import footerStyles from '../styles/Footer.module.scss';
33
import { linksNav } from '../utils/links';
44
import NewsletterSubscribe from './mailchimp/NewsletterSubscribe';
55
import Image from 'next/image';
6+
import Container from './Container';
67

78
export default function Footer() {
89
return (
910
<footer className={footerStyles.footer}>
1011
<NewsletterSubscribe />
11-
<section className={footerStyles.footer__section}>
12+
<Container className={footerStyles.footer__inner}>
1213
<nav className={footerStyles.footer__nav} aria-label="Main">
1314
<ul className={footerStyles.footer__navList}>
1415
{linksNav.map(link => (
@@ -25,10 +26,11 @@ export default function Footer() {
2526
height={326}
2627
width={326}
2728
alt="Logo"
29+
priority
2830
/>
2931
</a>
3032
</Link>
31-
</section>
33+
</Container>
3234
</footer>
3335
);
3436
}

components/TwoColumn.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Image from 'next/image';
22
import ButtonLink from './ButtonLink';
3+
import Container from './Container';
34
import styles from '../styles/TwoColumn.module.scss';
45
import buttonStyles from '../styles/ButtonLink.module.scss';
56

@@ -24,17 +25,17 @@ export default function TwoColumn({
2425
color: btnColor,
2526
backgroundColor: btnBg,
2627
},
27-
container: {
28+
wrapper: {
2829
color: color,
2930
backgroundColor: bgColor,
3031
},
3132
};
3233

3334
return (
34-
<section className={styles.container} style={styleProps.container}>
35-
<div
35+
<section className={styles.wrapper} style={styleProps.wrapper}>
36+
<Container
3637
className={`${styles.inner} ${styles[customInnerClass]}`}
37-
style={{ flexDirection: rowOrder }}
38+
styles={{ flexDirection: rowOrder }}
3839
>
3940
<div className={styles.inner__content}>
4041
<h2 className={styles.title} style={{ color: color }}>
@@ -63,7 +64,7 @@ export default function TwoColumn({
6364
/>
6465
</div>
6566
)}
66-
</div>
67+
</Container>
6768
</section>
6869
);
6970
}

components/mailchimp/NewsletterForm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react';
22
import { decode } from 'html-entities';
3+
import Container from '../Container';
34
import newsletterStyles from '../../styles/Newsletter.module.scss';
45

56
const NewsletterForm = ({ status, message, onValidated }) => {
@@ -65,7 +66,7 @@ const NewsletterForm = ({ status, message, onValidated }) => {
6566

6667
return (
6768
<section className={newsletterStyles.newsletter}>
68-
<div className={newsletterStyles.newsletter__container}>
69+
<Container className={newsletterStyles.newsletter__inner}>
6970
<h4 className={newsletterStyles.newsletter__title}>
7071
Sign up for news &#62;
7172
</h4>
@@ -114,7 +115,7 @@ const NewsletterForm = ({ status, message, onValidated }) => {
114115
)}
115116
</div>
116117
</div>
117-
</div>
118+
</Container>
118119
</section>
119120
);
120121
};

pages/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Link from 'next/link';
21
import Bracket from '../components/Bracket';
32
import Stick from '../components/Stick';
43
import TwoColumn from '../components/TwoColumn';
@@ -33,7 +32,6 @@ export default function Home() {
3332
content="Web Dev Path runs on volunteers. Here are the ways you can get involved with us:"
3433
rowOrder="row-reverse"
3534
customInnerClass="get-involved"
36-
color={primary}
3735
bgColor={white}
3836
/>
3937

-5.02 KB
Binary file not shown.
-8.54 KB
Binary file not shown.

styles/Card.module.scss

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22
@use './mixins' as *;
33

44
.card {
5-
margin: 1.5rem;
5+
margin: 1.5rem 0;
66
padding: 1.5rem;
77
border-radius: 1.5rem;
88
box-shadow: $box-shadow;
9-
min-width: 28%;
9+
min-width: 32%;
10+
1011
@include desktop {
11-
flex-basis: 28%;
12-
margin-bottom: 0;
12+
flex-basis: 32%;
13+
margin: 1.5rem 1.5rem 0 1.5rem;
14+
15+
&:first-child,
16+
&:last-child {
17+
margin: 1.5rem 0 0 0;
18+
}
1319
}
1420

1521
.title {

0 commit comments

Comments
 (0)