Skip to content

Commit c962fb4

Browse files
authored
授業IDを選択時に表示 (#464)
<!--変更したい場合は、`/.github/pull_request_template.md` を修正して下さい。--> # PRの概要 授業IDがないと判別できないケースが多いため選択時に表示するようにした <img width="421" alt="image" src="https://github.com/user-attachments/assets/a3b97cbd-3059-4192-9b56-77358cfb7b49"> ## 補足 <!-- レビューをする際に見てほしい点、ローカル環境で試す際の注意点、など --> ## レビューリクエストを出す前にチェック! - [x] 改めてセルフレビューしたか - [x] 手動での動作検証を行ったか - [x] server の機能追加ならば、テストを書いたか - 理由: 書いた | server の機能追加ではない - [x] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか - 理由: 書いた | 間違った使い方は存在しない - [x] わかりやすいPRになっているか <!-- レビューリクエスト後は、Slackでもメンションしてお願いすることを推奨します。 -->
1 parent ab23264 commit c962fb4

File tree

1 file changed

+32
-15
lines changed

1 file changed

+32
-15
lines changed

web/src/components/course/components/SelectCourseDialog.tsx

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,35 @@ export default function SelectCourseDialog({
6969
</DialogTitle>
7070
<DialogContent>
7171
<>
72-
<Box display="flex" alignItems="center" sx={{ width: "100%" }}>
73-
<Typography variant="body1">
74-
現在の授業: {currentEdit?.course?.name ?? "-"}
75-
</Typography>
76-
<IconButton
77-
aria-label="delete"
78-
onClick={async () => {
79-
if (!currentEdit?.course?.id) return;
72+
<Box>
73+
<Box px={1} pb={2}>
74+
<Typography variant="caption">現在の授業</Typography>
75+
{currentEdit?.course ? (
76+
<Box display="flex" alignItems="center" sx={{ width: "100%" }}>
77+
<Box flex={1}>
78+
<Typography variant="body1">
79+
{currentEdit?.course?.name ?? "-"}
80+
</Typography>
81+
<Typography variant="body2">{`${currentEdit?.course?.teacher ?? "-"} / ${
82+
currentEdit?.course?.id ?? "-"
83+
}`}</Typography>
84+
</Box>
85+
<IconButton
86+
aria-label="delete"
87+
onClick={async () => {
88+
if (!currentEdit?.course?.id) return;
8089

81-
setNewCourse(currentEdit.course);
82-
setIsDeleteConfirmDialogOpen(true);
83-
}}
84-
>
85-
<DeleteIcon />
86-
</IconButton>
90+
setNewCourse(currentEdit.course);
91+
setIsDeleteConfirmDialogOpen(true);
92+
}}
93+
>
94+
<DeleteIcon />
95+
</IconButton>
96+
</Box>
97+
) : (
98+
<Typography>未登録</Typography>
99+
)}
100+
</Box>
87101
</Box>
88102
<TextField
89103
onChange={(e) => {
@@ -111,7 +125,10 @@ export default function SelectCourseDialog({
111125
setIsConfirmDialogOpen(true);
112126
}}
113127
>
114-
{`${course.name}(${course.teacher})`}
128+
<Box>
129+
<Typography>{course.name}</Typography>
130+
<Typography variant="caption">{`${course.teacher} / ${course.id}`}</Typography>
131+
</Box>
115132
</ListItemButton>
116133
</ListItem>
117134
))}

0 commit comments

Comments
 (0)