Skip to content

Commit cda72bf

Browse files
committed
added TwoColumn and Button component
1 parent c2a4e11 commit cda72bf

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

components/Button.js

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

components/TwoColumn.js

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

styles/Button.module.scss

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

styles/TwoColumn.module.scss

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

0 commit comments

Comments
 (0)