-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Team-Blitz-Steady/steady-cl…
- Loading branch information
Showing
19 changed files
with
164 additions
and
107 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
77 changes: 77 additions & 0 deletions
77
src/app/(steady)/(application)/application/[steady_id]/[application_id]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
"use client"; | ||
|
||
import { usePathname, useRouter } from "next/navigation"; | ||
import { Question, Title } from "@/components/application"; | ||
import { useSuspenseQuery } from "@tanstack/react-query"; | ||
import getApplicationDetails from "@/services/application/getApplicationDetails"; | ||
import getSteadyDetails from "@/services/steady/getSteadyDetails"; | ||
import Button, { buttonSize } from "@/components/_common/Button"; | ||
import useApplicationListQuery from "@/hooks/query/useApplicationListQuery"; | ||
import { | ||
getApplicationDetailsKey, | ||
getSteadyDetailsKey, | ||
} from "@/constants/queryKeys"; | ||
|
||
const ApplicationPage = ({ | ||
params, | ||
}: { | ||
params: { steady_id: string; application_id: string }; | ||
}) => { | ||
const applicationId = params.application_id; | ||
const steadyId = params.steady_id; | ||
const pathname = usePathname(); | ||
const pageType = pathname.split("/")[2]; | ||
const router = useRouter(); | ||
const { data: applicationData } = useSuspenseQuery({ | ||
queryKey: getApplicationDetailsKey(applicationId), | ||
queryFn: () => getApplicationDetails(applicationId), | ||
}); | ||
|
||
const { data: steadyDetailsData } = useSuspenseQuery({ | ||
queryKey: getSteadyDetailsKey(steadyId), | ||
queryFn: () => getSteadyDetails(steadyId), | ||
staleTime: 10000, | ||
}); | ||
|
||
const { applicationListData } = useApplicationListQuery(); | ||
|
||
const application = applicationListData.pages.map( | ||
(page) => | ||
page.content.find( | ||
(item) => item.applicationId.toString() === applicationId, | ||
)?.status, | ||
)[0]; | ||
|
||
return ( | ||
<> | ||
<Title | ||
title={steadyDetailsData ? steadyDetailsData.name : "Temp"} | ||
pageType={pageType} | ||
> | ||
{applicationData.surveys.map((survey, index) => ( | ||
<Question | ||
key={index} | ||
question={survey.question} | ||
index={index} | ||
> | ||
<div className="h-100 w-full border-1">{survey.answer}</div> | ||
</Question> | ||
))} | ||
</Title> | ||
{application === "WAITING" && ( | ||
<div className="flex items-center justify-end"> | ||
<Button | ||
className={`${buttonSize.sm} bg-st-primary text-st-white`} | ||
onClick={() => | ||
router.push(`/application/edit/${steadyId}/${applicationId}`) | ||
} | ||
> | ||
수정 하기 | ||
</Button> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default ApplicationPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { cn } from "@/lib/utils"; | ||
import { useSuspenseQuery } from "@tanstack/react-query"; | ||
import getMyProfile from "@/services/user/getMyProfile"; | ||
import { MyProfileKey } from "@/constants/queryKeys"; | ||
import { appBarTextStyles } from "."; | ||
import Dropdown from "../Dropdown"; | ||
import NotificationPopup from "../NotificationPopup"; | ||
|
||
const AuthAppBar = () => { | ||
const { data: myProfileData } = useSuspenseQuery({ | ||
queryKey: MyProfileKey, | ||
queryFn: () => getMyProfile(), | ||
}); | ||
|
||
return ( | ||
<div className="flex w-150 items-center justify-between sm:w-170 md:w-250"> | ||
<Link href={"/mysteady"}> | ||
<div className={cn(appBarTextStyles, "w-50 md:w-80")}>내 스테디</div> | ||
</Link> | ||
<NotificationPopup /> | ||
<Dropdown | ||
options={[ | ||
{ label: "마이페이지", linkTo: "/mypage" }, | ||
{ label: "로그아웃", linkTo: "/logout" }, | ||
]} | ||
> | ||
<div className="flex h-30 w-30 items-center justify-center md:h-45 md:w-45"> | ||
<Image | ||
className="aspect-square rounded-full border-1" | ||
src={myProfileData.profileImage} | ||
alt="유저 로고" | ||
width={45} | ||
height={45} | ||
/> | ||
</div> | ||
</Dropdown> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AuthAppBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.