Skip to content

Commit edd3da6

Browse files
committed
admin画面でスクロールできないのを修正
1 parent e2d1e13 commit edd3da6

File tree

4 files changed

+48
-46
lines changed

4 files changed

+48
-46
lines changed

Diff for: packages/akane-next/src/app/admin/layout.tsx

+25-20
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,38 @@ import type { Metadata, Viewport } from "next";
33
import Script from "next/script";
44

55
export const metadata: Metadata = {
6-
title: "Akane 管理画面",
7-
description: "Akane 管理画面です。操作には注意してください。",
6+
title: "Akane 管理画面",
7+
description: "Akane 管理画面です。操作には注意してください。",
88
};
99

1010
export const viewport: Viewport = {
11-
width: "device-width",
12-
initialScale: 1.0,
13-
maximumScale: 1.0,
11+
width: "device-width",
12+
initialScale: 1.0,
13+
maximumScale: 1.0,
14+
};
15+
16+
export const scrollableStyle = {
17+
overflow: "scroll",
18+
height: "100%",
1419
};
1520

1621
export default function AdminRootLayout({
17-
children,
22+
children,
1823
}: Readonly<{
19-
children: React.ReactNode;
24+
children: React.ReactNode;
2025
}>) {
21-
return (
22-
<html lang="ja" suppressHydrationWarning>
23-
<body>
24-
<AdminPageLayout>{children}</AdminPageLayout>
25-
</body>
26+
return (
27+
<html lang="ja" suppressHydrationWarning>
28+
<body style={scrollableStyle} suppressHydrationWarning>
29+
<AdminPageLayout>{children}</AdminPageLayout>
30+
</body>
2631

27-
<Script
28-
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
29-
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
30-
crossOrigin="anonymous"
31-
strategy="afterInteractive"
32-
/>
33-
</html>
34-
);
32+
<Script
33+
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
34+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
35+
crossOrigin="anonymous"
36+
strategy="afterInteractive"
37+
/>
38+
</html>
39+
);
3540
}

Diff for: packages/akane-next/src/app/admin/page.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import Link from "next/link";
22

33
export default function AdminIndexPage() {
4-
return (
5-
<div className=" mt-3">
6-
<section>
7-
<h2 className="fw-bold fs-4">ストーリー関連</h2>
8-
<ul className="list-group">
9-
<li className="list-group-item">
10-
<Link href="/admin/story">ストーリー一覧</Link>
11-
</li>
12-
</ul>
13-
</section>
14-
</div>
15-
);
4+
return (
5+
<div className=" mt-3">
6+
<section>
7+
<h2 className="fw-bold fs-4">ストーリー関連</h2>
8+
<ul className="list-group">
9+
<li className="list-group-item">
10+
<Link href="/admin/story">ストーリー一覧</Link>
11+
</li>
12+
</ul>
13+
</section>
14+
</div>
15+
);
1616
}

Diff for: packages/akane-next/src/app/layout.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import "./globals.css";
33
import { Provider } from "@/components/ui/provider";
44
import { WithApolloProvider } from "@/graphql/provider";
55

6-
76
export const metadata: Metadata = {
87
title: "Create Next App",
98
description: "Generated by create next app",
@@ -16,11 +15,9 @@ export default function RootLayout({
1615
}>) {
1716
return (
1817
<html lang="ja" suppressHydrationWarning>
19-
<body>
18+
<body suppressHydrationWarning>
2019
<WithApolloProvider>
21-
<Provider>
22-
{children}
23-
</Provider>
20+
<Provider>{children}</Provider>
2421
</WithApolloProvider>
2522
</body>
2623
</html>

Diff for: packages/akane-next/src/components/admin/layout.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import type React from "react";
33
import { AdminNavbar } from "./navbar";
44

55
export const AdminPageLayout = ({ children }: React.PropsWithChildren) => {
6-
return (
7-
<div>
8-
<AdminNavbar />
9-
<main className="container">{children}</main>
10-
</div>
11-
);
6+
return (
7+
<div>
8+
<AdminNavbar />
9+
<main className="container">{children}</main>
10+
</div>
11+
);
1212
};
1313

1414
export const AdminPageLayoutDecorator = (Story: React.FC) => (
15-
<AdminPageLayout>
16-
<Story />
17-
</AdminPageLayout>
15+
<AdminPageLayout>
16+
<Story />
17+
</AdminPageLayout>
1818
);

0 commit comments

Comments
 (0)