Skip to content

Commit 5576880

Browse files
authored
Merge pull request #76 from AMSdesigns/feature/add-two-column
added TwoColumn and Button component
2 parents c2a4e11 + 862974e commit 5576880

File tree

6 files changed

+137
-1
lines changed

6 files changed

+137
-1
lines changed

components/ButtonLink.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Link from 'next/link';
2+
3+
export default function ButtonLink(props) {
4+
const { className, link, children } = props;
5+
return (
6+
<Link href={link}>
7+
<a className={className}>{children}</a>
8+
</Link>
9+
);
10+
}

components/TwoColumn.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import Image from 'next/image';
2+
import ButtonLink from './ButtonLink';
3+
import styles from '../styles/TwoColumn.module.scss';
4+
import buttonStyles from '../styles/ButtonLink.module.scss';
5+
6+
export default function TwoColumn(props) {
7+
const { image, title, content, rowOrder } = props;
8+
return (
9+
<section className={styles.container}>
10+
<div className={styles.inner} style={{ flexDirection: rowOrder }}>
11+
<div className={styles.itemLeft}>
12+
<h2 className={styles.title}>{title}</h2>
13+
<p className={styles.content}>{content}</p>
14+
<ButtonLink link="/about-us" className={buttonStyles.btn}>
15+
Learn more
16+
</ButtonLink>
17+
</div>
18+
<div className={styles.itemRight}>
19+
<Image
20+
src={image}
21+
alt=""
22+
className={styles.img}
23+
width={409}
24+
height={545}
25+
/>
26+
</div>
27+
</div>
28+
</section>
29+
);
30+
}

pages/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from 'next/link';
2+
import TwoColumn from '../components/TwoColumn';
23
import styles from '../styles/Home.module.scss';
34

45
export default function Home() {
@@ -12,8 +13,14 @@ export default function Home() {
1213
more...
1314
</p>
1415
</div>
15-
<hr className={styles.divider} />
1616

17+
<TwoColumn
18+
title="Let's grow together."
19+
image="/images/home-two-column-image.jpg"
20+
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. "
21+
/>
22+
23+
<hr className={styles.divider} />
1724
<h2 className={styles.centerText}>
1825
Would you answer "yes" to any of these questions?
1926
</h2>
209 KB
Loading

styles/ButtonLink.module.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@use 'variables';
2+
3+
.btn {
4+
padding: 0.5rem 2rem;
5+
color: #fff;
6+
background-color: #292929;
7+
border-radius: 2rem;
8+
transition: 0.3s ease;
9+
cursor: pointer;
10+
font-style: normal;
11+
font-weight: bold;
12+
font-size: 1.5rem;
13+
line-height: 2rem;
14+
align-items: center;
15+
text-align: center;
16+
min-width: 16rem;
17+
display: inline-block;
18+
border: none;
19+
}
20+
21+
.btn:hover {
22+
opacity: 0.6;
23+
}

styles/TwoColumn.module.scss

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
@use 'variables';
2+
3+
.container {
4+
width: 100vw;
5+
margin: 0 calc(50% - 50vw);
6+
background-color: #8cd5e8;
7+
}
8+
.inner {
9+
padding: 5rem 0;
10+
min-height: 50vh;
11+
margin: 0 auto;
12+
width: 90%;
13+
display: flex;
14+
justify-content: space-between;
15+
max-width: variables.$large-desktop-breakpoint;
16+
}
17+
18+
.title {
19+
font-family: 'Open Sans';
20+
font-style: normal;
21+
font-weight: bold;
22+
font-size: 4.5rem;
23+
line-height: 5rem;
24+
color: #292929;
25+
margin: 0;
26+
max-width: 39rem;
27+
}
28+
.itemLeft {
29+
width: 50%;
30+
text-align: left;
31+
}
32+
.itemRight {
33+
width: 50%;
34+
text-align: end;
35+
}
36+
37+
.content {
38+
font-style: normal;
39+
font-weight: normal;
40+
font-size: 1.5rem;
41+
line-height: 2rem;
42+
display: flex;
43+
align-items: center;
44+
margin: 3.875rem 0 2.5rem;
45+
}
46+
47+
.img {
48+
object-fit: cover;
49+
height: 100%;
50+
width: 100%;
51+
max-width: 25.5rem;
52+
max-height: 34rem;
53+
border-radius: 0.25rem;
54+
}
55+
56+
@media (max-width: variables.$tablet-breakpoint) {
57+
.inner {
58+
flex-direction: column;
59+
gap: 5rem;
60+
}
61+
.itemLeft,
62+
.itemRight {
63+
width: 100%;
64+
text-align: center;
65+
}
66+
}

0 commit comments

Comments
 (0)