Skip to content

Commit 0f440d3

Browse files
authored
Merge pull request #100 from first-contributions-ja/feat/#33_add_header
ヘッダーの追加
2 parents f9258ab + c87bac5 commit 0f440d3

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/app/layout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type { Metadata } from "next";
2+
import { SITE_NAME, SITE_URL, SITE_DESC } from "../../lib/constants";
23
import { Inter, Noto_Sans_JP } from "next/font/google";
34
import "./globals.css";
45
import Footer from "@/components/footer";
5-
import { SITE_NAME, SITE_URL, SITE_DESC } from "../../lib/constants";
6+
import Header from "@/components/header";
67

78
const inter = Inter({
89
subsets: ["latin"],
@@ -42,8 +43,8 @@ export default function RootLayout({
4243
}>) {
4344
return (
4445
<html lang="ja">
45-
<body className={`${inter.variable} ${notojp.variable}`}>
46-
<header>ヘッダー</header>
46+
<body className={`${inter.variable} ${notojp.variable} `}>
47+
<Header />
4748
{children}
4849
<Footer />
4950
</body>

src/components/header.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Link from "next/link";
2+
import { SITE_NAME } from "../../lib/constants";
3+
import GitHubIcon from '@mui/icons-material/GitHub';
4+
5+
export default function Header() {
6+
return (
7+
<header className="py-6 backdrop-blur-sm fixed w-full">
8+
<Link href="/">
9+
<h1 className="inline text-red-600 text-xl font-bold ml-7 hover:opacity-70 transition">
10+
<GitHubIcon fontSize="large" className="text-red-600 mr-4 -translate-y-0.5" />
11+
{SITE_NAME}
12+
</h1>
13+
</Link>
14+
</header>
15+
);
16+
}

0 commit comments

Comments
 (0)