Skip to content

Commit 34c44d6

Browse files
committed
ヘッダーコンポーネントの作成
1 parent dd82599 commit 34c44d6

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

public/images/rcc-favicon.png

18.1 KB
Loading

src/components/Header.tsx

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Image from "next/image";
2+
import Link from "next/link";
3+
4+
const Header = () => {
5+
return (
6+
<header className=" bg-slate-50 p-2 text-black opacity-90 shadow-sm">
7+
<div className="container mx-auto flex items-center justify-between">
8+
<div className="flex w-full items-center justify-center">
9+
<Image src="/images/rcc-favicon.png" alt="RCCのfaviconです" width={40} height={40} className="mr-5" />
10+
<h1 className="text-xl font-semibold ">
11+
<Link href="/">Snack</Link>
12+
</h1>
13+
</div>
14+
15+
{/* <nav>
16+
<ul className="flex space-x-4">
17+
<>
18+
<Link href="/login" className="bg-white text-gray-900 py-2 px-3 rounded-lg font-medium">
19+
ログイン
20+
</Link>
21+
<Link href="/signup" className="bg-white text-gray-900 py-2 px-3 rounded-lg font-medium">
22+
サインアップ
23+
</Link>
24+
</>
25+
</ul>
26+
</nav> */}
27+
</div>
28+
</header>
29+
);
30+
};
31+
32+
export default Header;

src/pages/_app.tsx

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
import '@/styles/globals.css'
2-
import type { AppProps } from 'next/app'
1+
import Header from "@/components/Header";
2+
import "@/styles/globals.css";
3+
import type { AppProps } from "next/app";
4+
import { useState } from "react";
35

46
export default function App({ Component, pageProps }: AppProps) {
5-
return <Component {...pageProps} />
7+
return (
8+
<div className="flex h-full w-full flex-col ">
9+
<div className="sticky top-0 z-10">
10+
<Header />
11+
</div>
12+
<div className=" hide-scrollbar h-full overflow-y-auto ">
13+
<Component {...pageProps} />
14+
</div>
15+
</div>
16+
);
617
}

0 commit comments

Comments
 (0)