-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/academic-relations/ar-002-clubs
- Loading branch information
Showing
30 changed files
with
622 additions
and
377 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,24 +1,59 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import { useEffect, useState } from "react"; | ||
|
||
import AsyncBoundary from "@sparcs-clubs/web/common/components/AsyncBoundary"; | ||
import FlexWrapper from "@sparcs-clubs/web/common/components/FlexWrapper"; | ||
import PageHead from "@sparcs-clubs/web/common/components/PageHead"; | ||
import LoginRequired from "@sparcs-clubs/web/common/frames/LoginRequired"; | ||
import NoManageClub from "@sparcs-clubs/web/common/frames/NoManageClub"; | ||
import { useAuth } from "@sparcs-clubs/web/common/providers/AuthContext"; | ||
import FundingDetailFrame from "@sparcs-clubs/web/features/manage-club/funding/detail/frames/FundingDetailFrame"; | ||
import { useGetMyManageClub } from "@sparcs-clubs/web/features/manage-club/services/getMyManageClub"; | ||
|
||
const FundingDetail = () => ( | ||
<FlexWrapper direction="column" gap={60}> | ||
<PageHead | ||
items={[ | ||
{ name: "대표 동아리 관리", path: "/manage-club" }, | ||
{ name: "지원금", path: "/manage-club/funding" }, | ||
]} | ||
title="지원금 신청" | ||
enableLast | ||
/> | ||
{/* TODO: 기간 맞춰서 isNow 설정 */} | ||
<FundingDetailFrame isNow /> | ||
</FlexWrapper> | ||
); | ||
const FundingDetail = () => { | ||
const { isLoggedIn, login, profile } = useAuth(); | ||
const [loading, setLoading] = useState(true); | ||
|
||
const { data, isLoading, isError } = useGetMyManageClub(); | ||
|
||
useEffect(() => { | ||
if (isLoggedIn !== undefined || profile !== undefined) { | ||
setLoading(false); | ||
} | ||
}, [isLoggedIn, profile]); | ||
|
||
if (loading) { | ||
return <AsyncBoundary isLoading={loading} isError />; | ||
} | ||
|
||
if (!isLoggedIn) { | ||
return <LoginRequired login={login} />; | ||
} | ||
|
||
if (profile?.type !== "undergraduate") { | ||
return <NoManageClub />; | ||
} | ||
|
||
if (!data || !("clubId" in data)) { | ||
return <AsyncBoundary isLoading={isLoading} isError={isError} />; | ||
} | ||
|
||
return ( | ||
<AsyncBoundary isLoading={isLoading} isError={isError}> | ||
<FlexWrapper direction="column" gap={60}> | ||
<PageHead | ||
items={[ | ||
{ name: "대표 동아리 관리", path: "/manage-club" }, | ||
{ name: "지원금", path: "/manage-club/funding" }, | ||
]} | ||
title="지원금 신청" | ||
enableLast | ||
/> | ||
{/* TODO: 기간 맞춰서 isNow 설정 */} | ||
<FundingDetailFrame isNow clubId={data.clubId} /> | ||
</FlexWrapper> | ||
</AsyncBoundary> | ||
); | ||
}; | ||
export default FundingDetail; |
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
Oops, something went wrong.