Skip to content

Commit a88cfb1

Browse files
committed
アイコン追加
1 parent 50a6d50 commit a88cfb1

File tree

6 files changed

+114
-29
lines changed

6 files changed

+114
-29
lines changed

app/favicon.ico

143 KB
Binary file not shown.

app/icon.png

26.3 KB
Loading

app/icon.svg

Lines changed: 39 additions & 0 deletions
Loading

app/manifest.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { MetadataRoute } from "next";
2+
import { metadata as pageMetadata } from "./page";
3+
4+
export default function manifest(): MetadataRoute.Manifest {
5+
return {
6+
// page.tsxからもってくる
7+
name: pageMetadata.title as string,
8+
short_name: pageMetadata.title as string,
9+
description: pageMetadata.description as string,
10+
start_url: "/",
11+
display: "standalone",
12+
// TODO:
13+
// background_color: "#fff",
14+
// theme_color: "#fff",
15+
icons: [
16+
{
17+
src: "/favicon.ico",
18+
sizes: "any",
19+
type: "image/x-icon",
20+
},
21+
{
22+
src: "/icon.svg",
23+
sizes: "any",
24+
type: "image/svg+xml",
25+
},
26+
{
27+
src: "/icon.png",
28+
sizes: "512x512",
29+
type: "image/png",
30+
},
31+
],
32+
};
33+
}

app/navbar.tsx

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,44 @@ import { ThemeToggle } from "./[docs_id]/themeToggle";
44
export function Navbar() {
55
return (
66
<>
7-
{/* fixedのヘッダーの分だけスクロールするコンテンツを下に移動するためのdiv */}
8-
<div className="h-16 lg:hidden" />
7+
{/* fixedのヘッダーの分だけスクロールするコンテンツを下に移動するためのdiv */}
8+
<div className="h-16 lg:hidden" />
99

10-
<div className="h-16 navbar bg-base-200 w-full fixed lg:hidden flex gap-4 z-40 shadow-md">
11-
<div className="flex-none">
12-
{/* サイドバーを開閉するボタン */}
13-
<label
14-
htmlFor="drawer-toggle"
15-
aria-label="open sidebar"
16-
className="btn btn-square btn-ghost"
17-
>
18-
<svg
19-
xmlns="http://www.w3.org/2000/svg"
20-
fill="none"
21-
viewBox="0 0 24 24"
22-
className="inline-block h-6 w-6 stroke-current"
10+
<div className="h-16 navbar bg-base-200 w-full fixed lg:hidden flex gap-4 z-40 shadow-md">
11+
<div className="flex-none">
12+
{/* サイドバーを開閉するボタン */}
13+
<label
14+
htmlFor="drawer-toggle"
15+
aria-label="open sidebar"
16+
className="btn btn-square btn-ghost"
2317
>
24-
<path
25-
strokeLinecap="round"
26-
strokeLinejoin="round"
27-
strokeWidth="2"
28-
d="M4 6h16M4 12h16M4 18h16"
29-
/>
30-
</svg>
31-
</label>
18+
<svg
19+
xmlns="http://www.w3.org/2000/svg"
20+
fill="none"
21+
viewBox="0 0 24 24"
22+
className="inline-block h-6 w-6 stroke-current"
23+
>
24+
<path
25+
strokeLinecap="round"
26+
strokeLinejoin="round"
27+
strokeWidth="2"
28+
d="M4 6h16M4 12h16M4 18h16"
29+
/>
30+
</svg>
31+
</label>
32+
</div>
33+
{/* サイドバーが常時表示されている場合のみ */}
34+
<Link href="/" className="flex-1 font-bold text-xl">
35+
<img
36+
src="/icon.svg"
37+
alt="icon"
38+
className="inline-block w-8 h-8 mr-2"
39+
/>
40+
my.code();
41+
</Link>
42+
<ThemeToggle />
43+
<AccountMenu />
3244
</div>
33-
{/* サイドバーが常時表示されている場合のみ */}
34-
<Link href="/" className="flex-1 font-bold text-xl">my.code();</Link>
35-
<ThemeToggle />
36-
<AccountMenu />
37-
</div>
3845
</>
3946
);
4047
}

app/sidebar.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,14 @@ export function Sidebar() {
109109
<div className="bg-base-200 h-full w-80 overflow-y-auto">
110110
{/* todo: 背景色ほんとにこれでいい? */}
111111
<h2 className="hidden lg:flex flex-row items-center p-4 gap-2">
112-
{/* サイドバーが常時表示されている場合のみ */}
112+
{/* サイドバーが常時表示されているlg以上の場合のみ */}
113113
<Link href="/" className="flex-1 text-xl font-bold">
114+
{/* TODO: サイドバーの幅が狭すぎてアイコンを小さくしないと入らない... */}
115+
<img
116+
src="/icon.svg"
117+
alt="icon"
118+
className="inline-block w-6 h-6 mr-1"
119+
/>
114120
my.code();
115121
</Link>
116122
<ThemeToggle />

0 commit comments

Comments
 (0)