Skip to content

Commit f9da396

Browse files
committed
added new props and scss exports
1 parent 07c0e73 commit f9da396

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

components/TwoColumn.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@ import buttonStyles from '../styles/ButtonLink.module.scss';
55

66
export default function TwoColumn(props) {
77
// Add rowOrder="row-reverse" prop to the component to reverse its order on desktop
8-
const { image, title, content, rowOrder, color, bgColor, btnColor, btnBg } =
9-
props;
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;
1021

1122
const styleProps = {
1223
btn: {
@@ -28,18 +39,18 @@ export default function TwoColumn(props) {
2839
</h2>
2940
<p className={styles.content}>{content}</p>
3041
<ButtonLink
31-
link="/about-us"
42+
link={link}
3243
className={buttonStyles.btn}
3344
styles={styleProps.btn}
3445
>
35-
Learn more
46+
{linkText}
3647
</ButtonLink>
3748
</div>
3849
{image && (
3950
<div className={styles.inner__image}>
4051
<Image
4152
src={image}
42-
alt=""
53+
alt={altTag}
4354
className={styles.img}
4455
layout="fill"
4556
objectFit="cover"

pages/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from 'next/link';
22
import TwoColumn from '../components/TwoColumn';
33
import styles from '../styles/Home.module.scss';
4+
import { white, primary } from '../styles/TwoColumn.module.scss';
45

56
export default function Home() {
67
return (
@@ -18,15 +19,17 @@ export default function Home() {
1819
title="Let's grow together."
1920
image="/images/home-two-column-image.jpg"
2021
content="The Web Dev Path is a team of professional developers project that aims to provide a comprehensive path for people who seek to begin their web development journey. "
22+
link="/about-us"
2123
/>
2224

2325
<TwoColumn
2426
title="Nonprofit?"
2527
content="Web Dev Path can help your nonprofit with web projects of various sizes. Connect with us to find out how."
26-
color="#ffffff"
27-
bgColor="#292929"
28-
btnColor="#292929"
29-
btnBg="#ffffff"
28+
color={white}
29+
bgColor={primary}
30+
btnColor={primary}
31+
btnBg={white}
32+
link="/about-us"
3033
/>
3134

3235
<hr className={styles.divider} />

styles/TwoColumn.module.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@use './mixins' as *;
33

44
.container {
5-
background-color: #8cd5e8;
5+
background-color: $light-bg-color;
66

77
.inner {
88
padding: 5rem 0;
@@ -63,3 +63,9 @@
6363
}
6464
}
6565
}
66+
67+
//Exports
68+
:export {
69+
white: $white;
70+
primary: $primary-content-color;
71+
}

0 commit comments

Comments
 (0)