Skip to content

Commit 5b42679

Browse files
Add: Footer structure component
1 parent 52a4b98 commit 5b42679

File tree

4 files changed

+59
-50
lines changed

4 files changed

+59
-50
lines changed

components/Footer.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import footerStyles from "../styles/Footer.module.css";
2+
3+
export default function Footer() {
4+
return (
5+
<footer className={footerStyles.footer}>
6+
<a
7+
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
8+
target="_blank"
9+
rel="noopener noreferrer"
10+
className={footerStyles.a}
11+
>
12+
Powered by{" "}
13+
<img
14+
src="/vercel.svg"
15+
alt="Vercel Logo"
16+
className={footerStyles.logo}
17+
/>
18+
</a>
19+
</footer>
20+
);
21+
}

components/Layout.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Nav from "./Nav";
22
import styles from "../styles/Layout.module.css";
3+
import Footer from "./Footer";
34

45
export default function Layout({ children }) {
56
return (
@@ -8,6 +9,7 @@ export default function Layout({ children }) {
89
<div className={styles.container}>
910
<main className={styles.main}>{children}</main>
1011
</div>
12+
<Footer />
1113
</>
1214
);
1315
}

pages/index.js

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -49,56 +49,6 @@ export default function Home() {
4949
</a>
5050
</div>
5151
</main>
52-
53-
<footer>
54-
<a
55-
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
56-
target="_blank"
57-
rel="noopener noreferrer"
58-
>
59-
Powered by{" "}
60-
<img src="/vercel.svg" alt="Vercel Logo" className="logo" />
61-
</a>
62-
</footer>
63-
64-
<style jsx>{`
65-
footer {
66-
width: 100%;
67-
height: 100px;
68-
border-top: 1px solid #eaeaea;
69-
display: flex;
70-
justify-content: center;
71-
align-items: center;
72-
}
73-
74-
footer img {
75-
margin-left: 0.5rem;
76-
}
77-
78-
footer a {
79-
display: flex;
80-
justify-content: center;
81-
align-items: center;
82-
}
83-
84-
a {
85-
color: inherit;
86-
text-decoration: none;
87-
}
88-
89-
code {
90-
background: #fafafa;
91-
border-radius: 5px;
92-
padding: 0.75rem;
93-
font-size: 1.1rem;
94-
font-family: Menlo, Monaco, Lucida Console, Liberation Mono,
95-
DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
96-
}
97-
98-
.logo {
99-
height: 1em;
100-
}
101-
`}</style>
10252
</div>
10353
);
10454
}

styles/Footer.module.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.footer {
2+
width: 100%;
3+
height: 100px;
4+
border-top: 1px solid #eaeaea;
5+
display: flex;
6+
justify-content: center;
7+
align-items: center;
8+
}
9+
10+
.footer img {
11+
margin-left: 0.5rem;
12+
}
13+
14+
.footer a {
15+
display: flex;
16+
justify-content: center;
17+
align-items: center;
18+
}
19+
20+
.a {
21+
color: inherit;
22+
text-decoration: none;
23+
}
24+
25+
/* code {
26+
background: #fafafa;
27+
border-radius: 5px;
28+
padding: 0.75rem;
29+
font-size: 1.1rem;
30+
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
31+
Bitstream Vera Sans Mono, Courier New, monospace;
32+
} */
33+
34+
.logo {
35+
height: 1em;
36+
}

0 commit comments

Comments
 (0)