- {messages && messages.length > 0 ? (
-
- {messages.map((m) =>
- m.isPicture ? (
-

- ) : (
-
- {editingMessageId === m.id ? (
-
+ ),
+ )}
+
+ ) : (
+
+ 最初のメッセージを送ってみましょう!
+
+ )}
+
- >
+
);
}
From d1798b12868cfe00e04d578c79a8e1746d0f9d0f Mon Sep 17 00:00:00 2001
From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com>
Date: Sun, 19 Jan 2025 15:05:06 +0900
Subject: [PATCH 6/9] =?UTF-8?q?=E3=83=81=E3=83=A5=E3=83=BC=E3=83=88?=
=?UTF-8?q?=E3=83=AA=E3=82=A2=E3=83=AB=E3=81=AE=E3=83=AC=E3=82=A4=E3=82=A2?=
=?UTF-8?q?=E3=82=A6=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/app/tutorial/layout.tsx | 21 ++++++++++++
web/app/tutorial/page.tsx | 54 ++++++++++++------------------
web/components/chat/RoomWindow.tsx | 4 +--
3 files changed, 44 insertions(+), 35 deletions(-)
create mode 100644 web/app/tutorial/layout.tsx
diff --git a/web/app/tutorial/layout.tsx b/web/app/tutorial/layout.tsx
new file mode 100644
index 00000000..d252f74e
--- /dev/null
+++ b/web/app/tutorial/layout.tsx
@@ -0,0 +1,21 @@
+import Link from "next/link";
+import Header from "~/components/Header";
+import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
+
+export default function TutorialPageLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+
+
+ {children}
+
+
+ ホーム画面へ
+
+
+
+ );
+}
diff --git a/web/app/tutorial/page.tsx b/web/app/tutorial/page.tsx
index 7982323d..87ed8771 100644
--- a/web/app/tutorial/page.tsx
+++ b/web/app/tutorial/page.tsx
@@ -1,12 +1,10 @@
"use client";
-import { Navigation, Pagination } from "swiper/modules";
+import { Navigation } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/react";
import "swiper/css";
import "swiper/css/navigation";
import "swiper/css/pagination";
-import Link from "next/link";
-import Header from "~/components/Header";
const tutorialSteps = [
{
@@ -41,36 +39,26 @@ const tutorialSteps = [
export default function Tutorial() {
return (
-
-
-
-
- {tutorialSteps.map((step) => (
-
-
-
{step.label}
-

-
-
- ))}
-
-
-
- ホーム画面へ
-
-
-
+
+
+ {tutorialSteps.map((step) => (
+
+
+
{step.label}
+

+
+
+ ))}
+
);
}
diff --git a/web/components/chat/RoomWindow.tsx b/web/components/chat/RoomWindow.tsx
index 6a6de342..128e60ed 100644
--- a/web/components/chat/RoomWindow.tsx
+++ b/web/components/chat/RoomWindow.tsx
@@ -145,7 +145,7 @@ export function RoomWindow(props: Props) {
);
return (
-
+
{room.matchingStatus !== "matched" && (
{messages && messages.length > 0 ? (
-
+
{messages.map((m) =>
m.isPicture ? (
![]()
Date: Sun, 19 Jan 2025 16:51:24 +0900
Subject: [PATCH 7/9] =?UTF-8?q?=E5=88=9D=E6=9C=9F=E7=99=BB=E9=8C=B2?=
=?UTF-8?q?=E3=81=A7=E3=80=81=E8=88=88=E5=91=B3=E5=88=86=E9=87=8E=E3=82=92?=
=?UTF-8?q?=E7=99=BB=E9=8C=B2=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?=
=?UTF-8?q?=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E3=80=82=20(#588)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
# PRの概要
## 具体的な変更内容
## 影響範囲
## 動作要件
## 補足
## レビューリクエストを出す前にチェック!
- [ ] 改めてセルフレビューしたか
- [ ] 手動での動作検証を行ったか
- [ ] server の機能追加ならば、テストを書いたか
- 理由: 書いた | server の機能追加ではない
- [ ] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか
- 理由: 書いた | 間違った使い方は存在しない
- [ ] わかりやすいPRになっているか
---
web/app/signup/common.tsx | 2 +-
web/app/signup/page.tsx | 9 +-
web/app/signup/steps/step1_profile.tsx | 2 +-
web/app/signup/steps/step4_course.tsx | 12 +-
web/app/signup/steps/step5_interests.tsx | 237 +++++++++++++++++++++++
5 files changed, 253 insertions(+), 9 deletions(-)
create mode 100644 web/app/signup/steps/step5_interests.tsx
diff --git a/web/app/signup/common.tsx b/web/app/signup/common.tsx
index c4cdbe32..6cd4a870 100644
--- a/web/app/signup/common.tsx
+++ b/web/app/signup/common.tsx
@@ -2,7 +2,7 @@ export type Caller = "registration" | "configMenu";
export type StepProps
= {
onSave: (t: T) => void;
prev?: T;
- caller: Caller;
+ caller?: Caller;
};
export type BackProp = {
diff --git a/web/app/signup/page.tsx b/web/app/signup/page.tsx
index 47d14a1a..155cb036 100644
--- a/web/app/signup/page.tsx
+++ b/web/app/signup/page.tsx
@@ -12,11 +12,12 @@ import Step1 from "./steps/step1_profile";
import Step2, { type Step2Data } from "./steps/step2_img";
import Confirmation from "./steps/step3_confirmation";
import Step4 from "./steps/step4_course";
+import Step5 from "./steps/step5_interests";
function Registration() {
const { enqueueSnackbar } = useSnackbar();
const router = useRouter();
- const [step, setStep] = useState<1 | 2 | 3 | 4>(1);
+ const [step, setStep] = useState<1 | 2 | 3 | 4 | 5>(1);
const [step1Data, setStep1Data] = useState();
const [step2Data, setStep2Data] = useState();
@@ -71,7 +72,9 @@ function Registration() {
/>
);
case 4:
- return ;
+ return setStep(5)} />;
+ case 5:
+ return setStep(4)} />;
}
}
export default function RegistrationPage() {
@@ -79,7 +82,7 @@ export default function RegistrationPage() {
-
diff --git a/web/app/signup/steps/step1_profile.tsx b/web/app/signup/steps/step1_profile.tsx
index 485bffde..4b84521e 100644
--- a/web/app/signup/steps/step1_profile.tsx
+++ b/web/app/signup/steps/step1_profile.tsx
@@ -43,7 +43,7 @@ export default function Step1({ onSave, prev, caller }: StepProps
) {
}, [selectedFaculty, setValue, resetField]);
return (
<>
-
+
アカウント設定
);
diff --git a/web/app/signup/steps/step5_interests.tsx b/web/app/signup/steps/step5_interests.tsx
new file mode 100644
index 00000000..7b60ea04
--- /dev/null
+++ b/web/app/signup/steps/step5_interests.tsx
@@ -0,0 +1,237 @@
+"use client";
+
+import type { InterestSubject } from "common/types";
+import { useRouter } from "next/navigation";
+import { enqueueSnackbar } from "notistack";
+import { useEffect, useState } from "react";
+import { MdAdd, MdClose } from "react-icons/md";
+import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
+import { useAlert } from "~/components/common/alert/AlertProvider";
+import * as subject from "../../../api/subject";
+import type { BackProp } from "../common";
+
+export default function Step5({ back }: BackProp) {
+ const { state } = subject.useMyInterests();
+ const data = state.data;
+ const error = state.current === "error" ? state.error : null;
+ const loading = state.current === "loading";
+
+ const router = useRouter();
+ const { showAlert } = useAlert();
+
+ const [allSubjects, setAllSubjects] = useState
([]);
+ const [filteredSubjects, setFilteredSubjects] = useState(
+ [],
+ );
+ const [draftSubjects, setDraftSubjects] = useState(
+ data ?? [],
+ );
+ const [isOpen, setIsOpen] = useState(false);
+ const [newSubjectName, setNewSubjectName] = useState("");
+
+ useEffect(() => {
+ getSubjects();
+ }, []);
+
+ useEffect(() => {
+ setDraftSubjects(data ?? []);
+ }, [data]);
+
+ async function getSubjects() {
+ const subjects = await subject.getAll();
+ setAllSubjects(subjects);
+ setFilteredSubjects(subjects);
+ }
+
+ async function updateInterests(data: {
+ interestSubjects: InterestSubject[];
+ }) {
+ const ids = data.interestSubjects.map((d) => d.id);
+ const result = await subject.update(ids);
+ if (!result.ok) {
+ enqueueSnackbar("興味分野の保存に失敗しました", { variant: "error" });
+ } else {
+ enqueueSnackbar("興味分野を保存しました", { variant: "success" });
+ }
+ }
+
+ async function createSubject(name: string) {
+ const result = await subject.create(name);
+ if (!result.ok) {
+ enqueueSnackbar("興味分野の作成に失敗しました", { variant: "error" });
+ } else {
+ enqueueSnackbar("興味分野を作成しました", { variant: "success" });
+ }
+ }
+
+ function handleBack() {
+ // TODO: 差分がないときは確認なしで戻る
+ showAlert({
+ AlertMessage: "変更がある場合は、破棄されます。",
+ subAlertMessage: "本当にページを移動しますか?",
+ yesMessage: "移動",
+ clickYes: () => {
+ back();
+ },
+ });
+ }
+
+ return loading ? (
+
+ ) : error ? (
+ Error: {error.message}
+ ) : !data ? (
+ データがありません。
+ ) : (
+ <>
+
+
+
+
+ {draftSubjects.map((subject, index) => (
+
+ #{subject.name}
+
+
+ ))}
+
+
+ {
+ const newFilteredSubjects = allSubjects.filter((subject) =>
+ subject.name.includes(e.target.value.trim()),
+ );
+ setFilteredSubjects(newFilteredSubjects);
+ }}
+ placeholder="興味分野タグを絞り込み"
+ className="input input-bordered w-full"
+ />
+
+
+ {filteredSubjects.length !== 0 ? (
+ filteredSubjects
+ .filter(
+ (subject) =>
+ !draftSubjects.some((draft) => draft.id === subject.id),
+ )
+ .map((subject) => (
+ -
+
+
+ ))
+ ) : (
+ -
+ 検索結果がありません
+
+ )}
+ -
+
+
+
+
+
+
+
+
+
+
+ {isOpen && (
+
+ )}
+ >
+ );
+}
From 18a4d0f2b5c11c5f8a7b417bc884ab621c6ecc23 Mon Sep 17 00:00:00 2001
From: naka-12 <104970808+naka-12@users.noreply.github.com>
Date: Sun, 19 Jan 2025 20:38:18 +0900
Subject: [PATCH 8/9] =?UTF-8?q?chat=20=E7=94=BB=E9=9D=A2=E3=81=AE=20overfl?=
=?UTF-8?q?ow=20=E3=82=92=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/app/chat/layout.tsx | 2 +-
web/components/chat/RoomWindow.tsx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/app/chat/layout.tsx b/web/app/chat/layout.tsx
index 8866a802..ef128dd9 100644
--- a/web/app/chat/layout.tsx
+++ b/web/app/chat/layout.tsx
@@ -10,7 +10,7 @@ export default function ChatPageLayout({
return (
- {children}
+ {children}
);
diff --git a/web/components/chat/RoomWindow.tsx b/web/components/chat/RoomWindow.tsx
index 128e60ed..8748523f 100644
--- a/web/components/chat/RoomWindow.tsx
+++ b/web/components/chat/RoomWindow.tsx
@@ -145,7 +145,7 @@ export function RoomWindow(props: Props) {
);
return (
-
+
{room.matchingStatus !== "matched" && (
{messages && messages.length > 0 ? (
-
+
{messages.map((m) =>
m.isPicture ? (
![]()
Date: Tue, 21 Jan 2025 20:10:50 +0900
Subject: [PATCH 9/9] fix message ui
---
web/components/chat/RoomWindow.tsx | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/web/components/chat/RoomWindow.tsx b/web/components/chat/RoomWindow.tsx
index 8748523f..ecbfa406 100644
--- a/web/components/chat/RoomWindow.tsx
+++ b/web/components/chat/RoomWindow.tsx
@@ -209,13 +209,11 @@ export function RoomWindow(props: Props) {
) : (
-
- {m.content}
-
+
{m.content}
{m.creator === myId && (