Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MyCareerPageにサイドバーを設置 #33

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 38 additions & 24 deletions src/app/future-time-line/page.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<main className="flex min-h-screen flex-col items-center justify-between md:p-24">
<FutureTimeLine milestones={milestones} />
</main>
)
}
const router = useRouter();
const [user, isLoading] = useAuthState(auth);
const redirectLogin = () => {
router.push("/login");
};

if (isLoading)
return (
<div
className="flex justify-center items-center h-screen"
aria-label="Loading..."
>
<div className="animate-spin h-10 w-10 border-4 border-gray-500 rounded-full border-t-transparent"></div>
</div>
);

return user ? (
<div className="flex w-screen">
<Sidebar />
<div className="h-screen w-full overflow-scroll">
<main className="flex flex-col items-center justify-between md:p-24">
<FutureTimeLine milestones={userInfos[0].milestones} />
</main>
</div>
</div>
) : (
redirectLogin()
);
};

export default FutureTimeLinePage
export default FutureTimeLinePage;
8 changes: 8 additions & 0 deletions src/components/organisms/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ const Sidebar = () => {
}
path="/setting"
/>
<SidebarIcon
icon={
<span className="material-symbols-outlined material-icons text-3xl cursor-pointer">
map
</span>
}
path="/future-time-line"
/>
<SidebarIcon
icon={
<span className="material-symbols-outlined material-icons text-3xl cursor-pointer">
Expand Down
Loading