Skip to content

Commit 0d5e0f0

Browse files
Changing component name, adjusting styles
1 parent 264d385 commit 0d5e0f0

File tree

11 files changed

+81
-95
lines changed

11 files changed

+81
-95
lines changed

components/Card.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ import Image from 'next/image';
22
import Link from 'next/link';
33
import styles from '../styles/Card.module.scss';
44

5-
export default function Card(props) {
6-
const { image, altTag, title, content, link, linkText } = props;
7-
5+
export default function Card({
6+
image,
7+
altTag,
8+
title,
9+
content,
10+
link,
11+
linkText,
12+
}) {
813
return (
914
<div className={styles.card}>
1015
<div className={styles.card__image}>

components/ThreeColumn.js renamed to components/CardsColumns.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import Card from './Card';
2-
import styles from '../styles/ThreeColumn.module.scss';
3-
4-
export default function ThreeColumn(props) {
5-
const { images, altTags, titles, content, links, linkText } = props;
2+
import styles from '../styles/CardsColumns.module.scss';
63

4+
export default function CardsColumns({
5+
images,
6+
altTags,
7+
titles,
8+
content,
9+
links,
10+
linkText,
11+
}) {
712
return (
813
<section className={styles.container}>
914
<div className={styles.inner__content}>

components/Layout.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import Nav from './Nav';
22
import Meta from './Meta';
3-
import styles from '../styles/Layout.module.scss';
43
import Footer from './Footer';
54

65
export default function Layout({ children }) {
76
return (
87
<>
98
<Meta />
109
<Nav />
11-
<div className={styles.container}>
12-
<main className={styles.main}>{children}</main>
13-
</div>
10+
<main>{children}</main>
1411
<Footer />
1512
</>
1613
);

components/TwoColumn.js

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ import ButtonLink from './ButtonLink';
33
import styles from '../styles/TwoColumn.module.scss';
44
import buttonStyles from '../styles/ButtonLink.module.scss';
55

6-
export default function TwoColumn(props) {
6+
export default function TwoColumn({
7+
image,
8+
altTag,
9+
title,
10+
content,
11+
rowOrder,
12+
color,
13+
bgColor,
14+
btnColor,
15+
btnBg,
16+
link,
17+
customInnerClass,
18+
linkText = 'Learn more',
19+
}) {
720
// Add rowOrder="row-reverse" prop to the component to reverse its order on desktop
8-
const {
9-
image,
10-
altTag,
11-
title,
12-
content,
13-
rowOrder,
14-
color,
15-
bgColor,
16-
btnColor,
17-
btnBg,
18-
link,
19-
linkText = 'Learn more',
20-
} = props;
2121

2222
const styleProps = {
2323
btn: {
@@ -32,7 +32,10 @@ export default function TwoColumn(props) {
3232

3333
return (
3434
<section className={styles.container} style={styleProps.container}>
35-
<div className={styles.inner} style={{ flexDirection: rowOrder }}>
35+
<div
36+
className={`${styles.inner} ${styles[customInnerClass]}`}
37+
style={{ flexDirection: rowOrder }}
38+
>
3639
<div className={styles.inner__content}>
3740
<h2 className={styles.title} style={{ color: color }}>
3841
{title}

pages/index.js

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Link from 'next/link';
22
import Bracket from '../components/Bracket';
33
import Stick from '../components/Stick';
44
import TwoColumn from '../components/TwoColumn';
5-
import ThreeColumn from '../components/ThreeColumn';
5+
import CardsColumns from '../components/CardsColumns';
66
import styles from '../styles/Home.module.scss';
77
import { white, primary } from '../styles/TwoColumn.module.scss';
88

@@ -32,11 +32,12 @@ export default function Home() {
3232
title="Get involved."
3333
content="Web Dev Path runs on volunteers. Here are the ways you can get involved with us:"
3434
rowOrder="row-reverse"
35+
customInnerClass="get-involved"
3536
color={primary}
3637
bgColor={white}
3738
/>
3839

39-
<ThreeColumn
40+
<CardsColumns
4041
titles={['Join us', 'Volunteer', 'Become a mentor']}
4142
images={[
4243
'/images/join-us.jpg',
@@ -49,8 +50,8 @@ export default function Home() {
4950
'Would you like to volunteer? For roles other than mentor/mentee, please get in touch.',
5051
'Are you an experienced web dev who wants to become a mentor? Welcome!',
5152
]}
52-
links={['/about-us', '/about-us', '/about-us']}
53-
linkText={['Learn more', 'Contact us', 'Contact us']}
53+
links={['/about-us', '/contact-us', '/about-us']}
54+
linkText={['Learn more', 'Contact us', 'Learn more']}
5455
/>
5556

5657
<Stick className={styles.stick} />
@@ -63,40 +64,8 @@ export default function Home() {
6364
btnColor={primary}
6465
btnBg={white}
6566
link="/about-us"
67+
customInnerClass="non-profit"
6668
/>
67-
68-
<hr className={styles.divider} />
69-
<h2 className={styles.centerText}>
70-
Would you answer "yes" to any of these questions?
71-
</h2>
72-
<div className={styles.grid}>
73-
<div className={styles.card}>
74-
<p>Are you learning web development and need mentorship?</p>
75-
</div>
76-
<div className={styles.card}>
77-
<p>Are you an experienced web dev who wants to become a mentor?</p>
78-
</div>
79-
<div className={styles.card}>
80-
<p>
81-
Are you a non-profit organization who needs help with a web
82-
project?
83-
</p>
84-
</div>
85-
<div className={styles.card}>
86-
<p>
87-
Are you a web dev looking for help or a code buddy for a project?
88-
</p>
89-
</div>
90-
</div>
91-
<div className={`${styles.learn_more} ${styles.centerText}`}>
92-
<h3>
93-
If so, you are probably in the right place and should learn more
94-
about us
95-
</h3>
96-
<button className={styles.button}>
97-
<Link href="/about-us">Learn More</Link>
98-
</button>
99-
</div>
10069
</div>
10170
</section>
10271
);

styles/ThreeColumn.module.scss renamed to styles/CardsColumns.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@
1212
display: flex;
1313
flex-wrap: wrap;
1414
justify-content: center;
15+
16+
@include desktop-breakpoint-minus {
17+
padding-bottom: 5rem;
18+
}
1519
}
1620
}

styles/Home.module.scss

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,23 @@ hr {
113113
transform: translate(-10rem, -5rem);
114114
}
115115

116-
@media (min-width: $desktop-breakpoint-large) {
116+
@include desktop-breakpoint-plus {
117117
.title {
118118
font-size: 4rem;
119119
}
120120

121121
.bracket {
122-
transform: translate(20rem, -5rem);
122+
transform: translate(50%, -5rem);
123+
width: 30%;
123124
}
124125

125126
.stick {
126-
transform: translate(-20rem, -5rem);
127+
transform: translate(-50%, -5rem);
128+
width: 30%;
127129
}
128130
}
129131

130-
@media (max-width: $desktop-breakpoint-small) {
132+
@include desktop-breakpoint-minus {
131133
.bracket {
132134
display: none;
133135
}
@@ -136,18 +138,3 @@ hr {
136138
display: none;
137139
}
138140
}
139-
140-
@media (max-width: $tablet-breakpoint) {
141-
.grid {
142-
width: 100%;
143-
flex-direction: column;
144-
margin: 3rem 0;
145-
}
146-
147-
.card {
148-
max-width: none;
149-
margin: 0.5rem;
150-
width: 90%;
151-
min-height: 7rem;
152-
}
153-
}

styles/Layout.module.scss

Lines changed: 0 additions & 11 deletions
This file was deleted.

styles/TwoColumn.module.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,23 @@
1010
width: 90%;
1111
max-width: $large-desktop-breakpoint;
1212

13+
&.get-involved {
14+
@include desktop-breakpoint-minus {
15+
padding-bottom: 0;
16+
}
17+
}
18+
19+
&.non-profit {
20+
@include desktop-breakpoint-minus {
21+
.inner__content {
22+
margin-bottom: 0;
23+
}
24+
}
25+
}
26+
1327
.inner__content {
1428
margin-bottom: 5rem;
29+
1530
@include desktop {
1631
flex-basis: 50%;
1732
margin-bottom: 0;

styles/_mixins.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,24 @@
2121
}
2222
}
2323

24+
@mixin desktop-breakpoint-plus {
25+
@media (min-width: $desktop-breakpoint-plus) {
26+
@content;
27+
}
28+
}
29+
2430
@mixin large-desktop {
2531
@media (min-width: $large-desktop-breakpoint) {
2632
@content;
2733
}
2834
}
2935

36+
@mixin desktop-breakpoint-minus {
37+
@media (max-width: $desktop-breakpoint-minus) {
38+
@content;
39+
}
40+
}
41+
3042
@mixin mobile {
3143
@media (max-width: $lg-mobile-breakpoint) {
3244
@content;

0 commit comments

Comments
 (0)