Skip to content

Commit 07c0e73

Browse files
committed
updated TwoColumn.js
1 parent db10136 commit 07c0e73

File tree

4 files changed

+48
-16
lines changed

4 files changed

+48
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1616

1717
### Added
1818

19-
- add TwoColumn.js component
2019
- add new footer and newsletter components styling
2120

2221
### Fixed
2322

2423
- updated Next.js from 10.0.0 to 12.0.10
2524
- fixed scroll-x added by the layout container, adjust README
25+
- updated TwoColumn.js component with style props

components/ButtonLink.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import Link from 'next/link';
22

33
export default function ButtonLink(props) {
4-
const { className, link, children } = props;
4+
const { className, link, children, styles } = props;
55
return (
66
<Link href={link}>
7-
<a className={className}>{children}</a>
7+
<a className={className} style={styles}>
8+
{children}
9+
</a>
810
</Link>
911
);
1012
}

components/TwoColumn.js

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,47 @@ 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 } = props;
8+
const { image, title, content, rowOrder, color, bgColor, btnColor, btnBg } =
9+
props;
10+
11+
const styleProps = {
12+
btn: {
13+
color: btnColor,
14+
backgroundColor: btnBg,
15+
},
16+
container: {
17+
color: color,
18+
backgroundColor: bgColor,
19+
},
20+
};
21+
922
return (
10-
<section className={styles.container}>
23+
<section className={styles.container} style={styleProps.container}>
1124
<div className={styles.inner} style={{ flexDirection: rowOrder }}>
1225
<div className={styles.inner__content}>
13-
<h2 className={styles.title}>{title}</h2>
26+
<h2 className={styles.title} style={{ color: color }}>
27+
{title}
28+
</h2>
1429
<p className={styles.content}>{content}</p>
15-
<ButtonLink link="/about-us" className={buttonStyles.btn}>
30+
<ButtonLink
31+
link="/about-us"
32+
className={buttonStyles.btn}
33+
styles={styleProps.btn}
34+
>
1635
Learn more
1736
</ButtonLink>
1837
</div>
19-
<div className={styles.inner__image}>
20-
<Image
21-
src={image}
22-
alt=""
23-
className={styles.img}
24-
layout="fill"
25-
objectFit="cover"
26-
/>
27-
</div>
38+
{image && (
39+
<div className={styles.inner__image}>
40+
<Image
41+
src={image}
42+
alt=""
43+
className={styles.img}
44+
layout="fill"
45+
objectFit="cover"
46+
/>
47+
</div>
48+
)}
2849
</div>
2950
</section>
3051
);

pages/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ export default function Home() {
2020
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. "
2121
/>
2222

23+
<TwoColumn
24+
title="Nonprofit?"
25+
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"
30+
/>
31+
2332
<hr className={styles.divider} />
2433
<h2 className={styles.centerText}>
2534
Would you answer "yes" to any of these questions?

0 commit comments

Comments
 (0)