From 71abc48fd4525b9194df848a6915ab4dfc11c354 Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Sun, 1 Sep 2024 22:36:21 +0900
Subject: 確認画面まで作成する
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/SignUpConfirm.tsx | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/SignUpConfirm.tsx

(limited to 'src/SignUpConfirm.tsx')

diff --git a/src/SignUpConfirm.tsx b/src/SignUpConfirm.tsx
new file mode 100644
index 0000000..295bad6
--- /dev/null
+++ b/src/SignUpConfirm.tsx
@@ -0,0 +1,33 @@
+import './SignUp.css'
+import { useLocation, Navigate } from 'react-router-dom';
+import { Form } from './signUpSchema'
+
+export const SignUpConfirm = () => {
+  const location = useLocation()
+
+  const form = location.state as Form | null;
+
+  // form1 のデータがない場合は form1 にリダイレクトする
+  if (form === null) {
+    return <Navigate replace to="/sign-up/form1" />
+  }
+
+  return (
+    <>
+      <h1>会員登録 確認画面</h1>
+      <div>
+        <h2>あなたの情報</h2>
+        <div className="signUpForm">
+          <p>お名前: {form.name}</p>
+          <p>名前カナ: {form.kana}</p>
+          <p>電話番号: {form.tel1}-{form.tel2}-{form.tel3}</p>
+        </div>
+        <h2>ログイン関連の情報</h2>
+        <div className="signUpForm">
+          <p>メールアドレス: {form.email}</p>
+          <p>パスワード: セキュリティ上の理由のため非表示</p>
+        </div>
+      </div>
+    </>
+  );
+}
-- 
cgit v1.2.3

