Skip to content

Commit 9a26071

Browse files
committed
edit 周りを修正
1 parent 9f25001 commit 9a26071

File tree

3 files changed

+323
-361
lines changed

3 files changed

+323
-361
lines changed

web/app/edit/courses/page.tsx

Lines changed: 22 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"use client";
22

3-
import { Box, Typography } from "@mui/material";
43
import Link from "next/link";
54
import { useAboutMe } from "~/api/user";
65
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
7-
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
86
import EditableCoursesTable from "~/components/course/EditableCoursesTable";
97

108
export default function EditCourses() {
@@ -14,48 +12,27 @@ export default function EditCourses() {
1412
const error = state.current === "error" ? state.error : null;
1513

1614
return (
17-
<NavigateByAuthState type="toLoginForUnauthenticated">
18-
<Box
19-
sx={{
20-
padding: "20px",
21-
maxWidth: "350px",
22-
height: "100%",
23-
margin: "0 auto",
24-
display: "flex",
25-
flexDirection: "column",
26-
textAlign: "center",
27-
}}
28-
>
29-
<Typography variant="h6" component="h1" mb={1}>
30-
授業編集
31-
</Typography>
32-
{loading ? (
33-
<FullScreenCircularProgress />
34-
) : error ? (
35-
<p>Error: {error.message}</p>
36-
) : data ? (
37-
<>
38-
<EditableCoursesTable userId={data.id} />
39-
</>
40-
) : (
41-
<p>データがありません。</p>
42-
)}
43-
44-
<Box
45-
sx={{
46-
display: "flex",
47-
justifyContent: "space-between",
48-
marginTop: "20px",
49-
}}
50-
>
51-
<Link href="/settings/profile" className="btn">
52-
設定画面に戻る
53-
</Link>
54-
<Link href="/edit/profile" className="btn btn-primary">
55-
プロフィール編集へ
56-
</Link>
57-
</Box>
58-
</Box>
59-
</NavigateByAuthState>
15+
<div className="mx-auto my-0 flex h-full max-w-[350] flex-col p-5 text-center">
16+
<h1 className="mb-2 text-xl">授業編集</h1>
17+
{loading ? (
18+
<FullScreenCircularProgress />
19+
) : error ? (
20+
<p>Error: {error.message}</p>
21+
) : data ? (
22+
<>
23+
<EditableCoursesTable userId={data.id} />
24+
</>
25+
) : (
26+
<p>データがありません。</p>
27+
)}
28+
<div className="mt-5 flex justify-between">
29+
<Link href="/settings/profile" className="btn">
30+
設定画面に戻る
31+
</Link>
32+
<Link href="/edit/profile" className="btn btn-primary">
33+
プロフィール編集へ
34+
</Link>
35+
</div>
36+
</div>
6037
);
6138
}

web/app/edit/layout.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
import { Box } from "@mui/material";
21
import Header from "~/components/Header";
2+
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
33

44
export default function EditPageLayout({
55
children,
66
}: {
77
children: React.ReactNode;
88
}) {
99
return (
10-
<>
10+
<NavigateByAuthState type="toLoginForUnauthenticated">
1111
<Header title="編集/Edit" />
12-
<Box
13-
sx={{
14-
position: "absolute", // TODO: absolute 指定しない
15-
top: {
16-
xs: "56px",
17-
sm: "64px",
18-
},
19-
bottom: "56px",
20-
left: 0,
21-
right: 0,
22-
overflowY: "auto",
23-
}}
24-
>
12+
<div className="absolute top-14 right-0 bottom-14 left-0 overflow-y-auto sm:top-16">
2513
{children}
26-
</Box>
27-
</>
14+
</div>
15+
</NavigateByAuthState>
2816
);
2917
}

0 commit comments

Comments
 (0)