Skip to content

Commit 9a358f1

Browse files
Add: logic inside Footer to render links
1 parent 1c78f3e commit 9a358f1

File tree

3 files changed

+17
-27
lines changed

3 files changed

+17
-27
lines changed

components/Footer.js

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
import Link from "next/link";
22
import footerStyles from "../styles/Footer.module.css";
3+
import { linksNav, linksSocial } from "../utils/links";
34

45
export default function Footer() {
56
return (
67
<footer className={footerStyles.footer}>
78
<div className={footerStyles.container}>
89
<div className={footerStyles.columnLeft}>
910
<ul className={footerStyles.footerList}>
10-
<li className={footerStyles.footerItem}>
11-
<Link href="/about-us">
12-
<a>About Us</a>
13-
</Link>
14-
</li>
15-
<li className={footerStyles.footerItem}>
16-
<Link href="/blog">
17-
<a>Blog</a>
18-
</Link>
19-
</li>
20-
<li className={footerStyles.footerItem}>
21-
<Link href="/contact-us">
22-
<a>Contact Us</a>
23-
</Link>
24-
</li>
11+
{linksNav.map((link) => (
12+
<li className={footerStyles.footerItem} key={link.href}>
13+
<Link href={link.href}>
14+
<a>{link.text}</a>
15+
</Link>
16+
</li>
17+
))}
2518
</ul>
2619
<img
2720
className={footerStyles.logo}
@@ -42,16 +35,15 @@ export default function Footer() {
4235
<p>*Unsubscribe anytime</p>
4336
</div>
4437
<div className={footerStyles.socialMedia}>
45-
<Link href="#">
46-
<img src="iconmonstr-github-1.svg" alt="Github" />
47-
</Link>
48-
<Link href="#">
49-
<img
50-
className={footerStyles.socialMedia__item}
51-
src="iconmonstr-twitter-4.svg"
52-
alt="Twitter"
53-
/>
54-
</Link>
38+
{linksSocial.map((link) => (
39+
<Link href={link.href} key={link.href}>
40+
<img
41+
className={footerStyles.socialMedia}
42+
src={link.src}
43+
alt={link.text}
44+
/>
45+
</Link>
46+
))}
5547
</div>
5648
</div>
5749
</div>

public/iconmonstr-github-1.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/iconmonstr-twitter-4.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)