Skip to content

Commit 175724d

Browse files
authored
基本的なコンポーネントを daisyUI に移行 (#515)
<!--変更したい場合は、`/.github/pull_request_template.md` を修正して下さい。--> # PRの概要 <!-- 変更の目的 もしくは 関連する Issue 番号 --> <!-- 以下のように書くと Issue にリンクでき、マージ時に自動で Issue を閉じられる--> <!-- closes #1 --> ## 具体的な変更内容 <!-- ビューの変更がある場合はスクショによる比較などがあるとわかりやすい --> ## 影響範囲 <!-- この関数を変更したのでこの機能にも影響がある、など --> ## 動作要件 <!-- 動作に必要な 環境変数 / 依存関係 / DBの更新 など --> ## 補足 <!-- レビューをする際に見てほしい点、ローカル環境で試す際の注意点、など --> ## レビューリクエストを出す前にチェック! - [ ] 改めてセルフレビューしたか - [ ] 手動での動作検証を行ったか - [ ] server の機能追加ならば、テストを書いたか - 理由: 書いた | server の機能追加ではない - [ ] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか - 理由: 書いた | 間違った使い方は存在しない - [ ] わかりやすいPRになっているか <!-- レビューリクエスト後は、Slackでもメンションしてお願いすることを推奨します。 -->
1 parent a91c531 commit 175724d

36 files changed

+723
-1053
lines changed

.cspell.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
"words": [
55
"autoincrement",
66
"bunx",
7+
"chrono",
78
"coursemate",
9+
"daisyui",
810
"datasource",
911
"direnv",
1012
"ECCS",
1113
"isready",
1214
"lockb",
15+
"mytheme",
1316
"notistack",
1417
"psql",
1518
"qiita",
19+
"reqwest",
1620
"safify",
1721
"supabase",
18-
"swiper",
19-
"reqwest",
20-
"chrono"
22+
"swiper"
2123
],
2224
"dictionaries": [
2325
"softwareTerms",

biome.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
"indentStyle": "space",
55
"indentWidth": 2
66
},
7+
"linter": {
8+
"rules": {
9+
"nursery": {
10+
"useSortedClasses": "warn"
11+
}
12+
}
13+
},
714
"vcs": {
815
"enabled": true,
916
"clientKind": "git",

web/app/chat/layout.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
1-
import { Box } from "@mui/material";
21
import BottomBar from "~/components/BottomBar";
32
import Header from "~/components/Header";
3+
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
44

55
export default function ChatPageLayout({
66
children,
77
}: {
88
children: React.ReactNode;
99
}) {
1010
return (
11-
<>
11+
<NavigateByAuthState type="toLoginForUnauthenticated">
1212
<Header title="チャット/Chat" />
13-
<Box
14-
sx={{
15-
position: "absolute", // TODO: absolute 指定しない
16-
top: {
17-
xs: "56px",
18-
sm: "64px",
19-
},
20-
bottom: "56px",
21-
left: 0,
22-
right: 0,
23-
overflowY: "auto",
24-
}}
25-
>
13+
<div className="absolute top-14 right-0 bottom-14 left-0 overflow-y-auto sm:top-16">
2614
{children}
27-
</Box>
15+
</div>
2816
<BottomBar activeTab="2_chat" />
29-
</>
17+
</NavigateByAuthState>
3018
);
3119
}

web/app/chat/page.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { useRoomsOverview } from "~/api/chat/hooks";
77
import RoomList from "~/components/chat/RoomList";
88
import { RoomWindow } from "~/components/chat/RoomWindow";
99
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
10-
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
1110

1211
function ChatListContent() {
1312
const searchParams = useSearchParams();
@@ -32,10 +31,8 @@ function ChatListContent() {
3231

3332
export default function Chat() {
3433
return (
35-
<NavigateByAuthState type="toLoginForUnauthenticated">
36-
<Suspense fallback={<FullScreenCircularProgress />}>
37-
<ChatListContent />
38-
</Suspense>
39-
</NavigateByAuthState>
34+
<Suspense fallback={<FullScreenCircularProgress />}>
35+
<ChatListContent />
36+
</Suspense>
4037
);
4138
}

web/app/edit/courses/page.tsx

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

3-
import { Box, Button, 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,65 +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-
<Button
52-
LinkComponent={Link}
53-
href="/settings/profile"
54-
style={{
55-
borderRadius: "25px",
56-
width: "35vw",
57-
boxShadow: "0px 4px 4px rgba(0, 0, 0, 0.25)",
58-
}}
59-
>
60-
設定画面に戻る
61-
</Button>
62-
<Button
63-
LinkComponent={Link}
64-
href="/edit/profile"
65-
variant="contained"
66-
style={{
67-
borderRadius: "25px",
68-
width: "35vw",
69-
boxShadow: "0px 4px 4px rgba(0, 0, 0, 0.25)",
70-
}}
71-
>
72-
プロフィール編集へ
73-
</Button>
74-
</Box>
75-
</Box>
76-
</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>
7737
);
7838
}

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 left-0 overflow-y-auto sm:top-16">
2513
{children}
26-
</Box>
27-
</>
14+
</div>
15+
</NavigateByAuthState>
2816
);
2917
}

0 commit comments

Comments
 (0)