Skip to content

Commit 663ea7b

Browse files
committed
fix TwoColumn and change name of Button component
1 parent b663caf commit 663ea7b

File tree

5 files changed

+45
-40
lines changed

5 files changed

+45
-40
lines changed

components/Button.js

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

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: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1+
import Image from 'next/image';
2+
import ButtonLink from './ButtonLink';
13
import styles from '../styles/TwoColumn.module.scss';
24
import buttonStyles from '../styles/Button.module.scss';
3-
import Button from './Button';
45

56
export default function TwoColumn(props) {
67
const { image, title, content, rowOrder } = props;
78
return (
8-
<div className={styles.container}>
9+
<section className={styles.container}>
910
<div className={styles.inner} style={{ flexDirection: rowOrder }}>
1011
<div className={styles.itemLeft}>
1112
<h2 className={styles.title}>{title}</h2>
1213
<p className={styles.content}>{content}</p>
13-
<Button
14-
text="Learn more"
15-
link="/about-us"
16-
className={buttonStyles.btn}
17-
/>
14+
<ButtonLink link="/about-us" className={buttonStyles.btn}>
15+
Learn more
16+
</ButtonLink>
1817
</div>
1918
<div className={styles.itemRight}>
20-
<img src={image} alt="" className={styles.img} />
19+
<Image
20+
src={image}
21+
alt=""
22+
className={styles.img}
23+
width={409}
24+
height={545}
25+
/>
2126
</div>
2227
</div>
23-
</div>
28+
</section>
2429
);
2530
}

styles/Button.module.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
@import 'variables';
1+
@use 'variables';
22

33
.btn {
4-
padding: 8px 32px;
4+
padding: 0.5rem 2rem;
55
color: #fff;
66
background-color: #292929;
7-
border-radius: 32px;
7+
border-radius: 2rem;
88
transition: 0.3s ease;
99
cursor: pointer;
10-
font-family: 'Assistant';
1110
font-style: normal;
1211
font-weight: bold;
13-
font-size: 24px;
14-
line-height: 31px;
12+
font-size: 1.5rem;
13+
line-height: 2rem;
1514
align-items: center;
1615
text-align: center;
17-
min-width: 256px;
16+
min-width: 16rem;
1817
display: inline-block;
18+
border: none;
1919
}
2020

2121
.btn:hover {

styles/TwoColumn.module.scss

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
@import 'variables';
1+
@use 'variables';
22

33
.container {
44
width: 100vw;
55
margin: 0 calc(50% - 50vw);
66
background-color: #8cd5e8;
77
}
88
.inner {
9-
padding: 80px 0;
9+
padding: 5rem 0;
1010
min-height: 50vh;
1111
margin: 0 auto;
1212
width: 90%;
1313
display: flex;
1414
justify-content: space-between;
15-
max-width: 1440px;
15+
max-width: variables.$large-desktop-breakpoint;
1616
}
1717

1818
.title {
1919
font-family: 'Open Sans';
2020
font-style: normal;
2121
font-weight: bold;
22-
font-size: 72px;
23-
line-height: 80px;
22+
font-size: 4.5rem;
23+
line-height: 5rem;
2424
color: #292929;
2525
margin: 0;
26-
max-width: 624px;
26+
max-width: 39rem;
2727
}
2828
.itemLeft {
2929
width: 50%;
@@ -35,28 +35,28 @@
3535
}
3636

3737
.content {
38-
font-family: 'Assistant';
3938
font-style: normal;
4039
font-weight: normal;
41-
font-size: 24px;
42-
line-height: 31px;
40+
font-size: 1.5rem;
41+
line-height: 2rem;
4342
display: flex;
4443
align-items: center;
45-
margin: 62px 0 40px;
44+
margin: 3.875rem 0 2.5rem;
4645
}
4746

4847
.img {
4948
object-fit: cover;
5049
height: 100%;
5150
width: 100%;
52-
max-width: 409px;
53-
max-height: 545px;
51+
max-width: 25.5rem;
52+
max-height: 34rem;
53+
border-radius: 0.25rem;
5454
}
5555

56-
@media (max-width: $tablet-breakpoint) {
56+
@media (max-width: variables.$tablet-breakpoint) {
5757
.inner {
5858
flex-direction: column;
59-
gap: 60px;
59+
gap: 5rem;
6060
}
6161
.itemLeft,
6262
.itemRight {

0 commit comments

Comments
 (0)