diff --git a/src/app/future-time-line/page.tsx b/src/app/future-time-line/page.tsx index ea698da..4e1893d 100644 --- a/src/app/future-time-line/page.tsx +++ b/src/app/future-time-line/page.tsx @@ -1,27 +1,41 @@ -'use client' -import React from 'react' -import milestones from '@/sample-data/milestones.json' -import FutureTimeLine from '@/components/organisms/FutureTimeLine' - -export type MileStone = { - userId: string; - milestoneId: string; - title: string; - content: string; - /** GCS内のファイル名 */ - imageHash: string; - /** RFC3339 */ - beginDate: string; - /** RFC3339 */ - finishDate: string; - } +"use client"; +import React from "react"; +import userInfos from "@/constants/json/user-info.json"; +import FutureTimeLine from "@/components/organisms/FutureTimeLine"; +import { useRouter } from "next/navigation"; +import { useAuthState } from "react-firebase-hooks/auth"; +import { auth } from "@/lib/firebase/client"; +import Sidebar from "@/components/organisms/Sidebar"; const FutureTimeLinePage = () => { - return ( -
- -
- ) -} + const router = useRouter(); + const [user, isLoading] = useAuthState(auth); + const redirectLogin = () => { + router.push("/login"); + }; + + if (isLoading) + return ( +
+
+
+ ); + + return user ? ( +
+ +
+
+ +
+
+
+ ) : ( + redirectLogin() + ); +}; -export default FutureTimeLinePage +export default FutureTimeLinePage; diff --git a/src/components/organisms/Sidebar.tsx b/src/components/organisms/Sidebar.tsx index cb4b129..cb7075a 100644 --- a/src/components/organisms/Sidebar.tsx +++ b/src/components/organisms/Sidebar.tsx @@ -44,6 +44,14 @@ const Sidebar = () => { } path="/setting" /> + + map + + } + path="/future-time-line" + />