-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: guest 도메인 추가
- Loading branch information
Showing
24 changed files
with
229 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import AttendeeInfoContainer from "@/components/programDetail/attendee/AttendeeInfo.container"; | ||
import ProgramInfo from "@/components/programDetail/program/ProgramInfo"; | ||
import UserAttendModalContainer from "@/components/programDetail/userAttendModal/UserAttendModal.container"; | ||
|
||
interface ProgramDetailPageProps { | ||
params: { | ||
programId: string; | ||
}; | ||
} | ||
|
||
const ProgramDetailPage = ({ params }: ProgramDetailPageProps) => { | ||
const { programId } = params; | ||
|
||
return ( | ||
<div className="mb-16 space-y-16"> | ||
<ProgramInfo programId={+programId} isLoggedIn={false} /> | ||
<AttendeeInfoContainer programId={+programId} isLoggedIn={false} /> | ||
<UserAttendModalContainer programId={+programId} isLoggedIn={false} /> | ||
</div> | ||
); | ||
}; | ||
export default ProgramDetailPage; |
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
FE/src/app/(guest)/layout.tsx → FE/src/app/(guest)/guest/layout.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
File renamed without changes.
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,98 @@ | ||
// TODO: 서버 컴포넌트로 변경하기 | ||
"use client"; | ||
|
||
import { useSearchParams } from "next/navigation"; | ||
import { Suspense, useEffect, useState } from "react"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
import ErrorFallback from "@/components/common/ErrorFallback"; | ||
import Tab from "@/components/common/tabs/Tab"; | ||
import TextTab from "@/components/common/tabs/TextTab"; | ||
import ProgramList from "@/components/main/ProgramList"; | ||
import ProgramListLoader from "@/components/main/ProgramList.loader"; | ||
import TeamBuildingDropup from "@/components/main/TeamBuildingDropup"; | ||
import MAIN from "@/constants/MAIN"; | ||
import PROGRAM from "@/constants/PROGRAM"; | ||
import { ProgramCategoryWithAll, ProgramStatus } from "@/types/program"; | ||
|
||
const MainPage = () => { | ||
const searchParams = useSearchParams(); | ||
|
||
// TODO: Hook으로 변경하기 | ||
const [queryValue, setQueryValue] = useState(MAIN.DEFAULT_QUERY); | ||
|
||
// TODO: useEffect를 Hook으로 변경하기 | ||
useEffect(() => { | ||
setQueryValue({ | ||
...MAIN.DEFAULT_QUERY, | ||
category: | ||
(searchParams.get("category") as ProgramCategoryWithAll) ?? "all", | ||
status: (searchParams.get("status") as ProgramStatus) ?? "active", | ||
page: searchParams.get("page") ?? "1", | ||
}); | ||
}, [searchParams]); | ||
|
||
useEffect(() => { | ||
window.history.replaceState( | ||
{}, | ||
"", | ||
`?category=${queryValue.category}&status=${queryValue.status}&page=${queryValue.page}`, | ||
); | ||
}, [queryValue]); | ||
|
||
const handleSetCategory = (category: ProgramCategoryWithAll) => { | ||
setQueryValue({ | ||
...queryValue, | ||
category, | ||
page: "1", | ||
}); | ||
}; | ||
|
||
const handleSetStatus = (status: ProgramStatus) => { | ||
setQueryValue({ | ||
...queryValue, | ||
status, | ||
page: "1", | ||
}); | ||
}; | ||
|
||
const handleSetPage = (page: number) => { | ||
setQueryValue({ | ||
...queryValue, | ||
page: page.toString(), | ||
}); | ||
}; | ||
|
||
// TODO: 합성 컴포넌트! | ||
return ( | ||
<div className="relative space-y-8"> | ||
<Tab<ProgramCategoryWithAll> | ||
options={Object.values(PROGRAM.CATEGORY_TAB_WITH_ALL)} | ||
selected={queryValue.category} | ||
onItemClick={(v) => handleSetCategory(v)} | ||
size="lg" | ||
baseColor="white" | ||
pointColor="navy" | ||
align="line" | ||
/> | ||
<TextTab<ProgramStatus> | ||
options={Object.values(PROGRAM.STATUS_TAB)} | ||
selected={queryValue.status} | ||
onClick={(v) => handleSetStatus(v)} | ||
/> | ||
<ErrorBoundary FallbackComponent={ErrorFallback}> | ||
<Suspense fallback={<ProgramListLoader />}> | ||
<ProgramList | ||
category={queryValue.category} | ||
programStatus={queryValue.status} | ||
page={+queryValue.page} | ||
setPage={handleSetPage} | ||
isLoggedIn={false} | ||
/> | ||
</Suspense> | ||
</ErrorBoundary> | ||
<TeamBuildingDropup /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MainPage; |
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,19 @@ | ||
"use client"; | ||
|
||
import ErrorFallback from "@/components/common/ErrorFallback"; | ||
|
||
const DetailPageError = () => { | ||
const error = { | ||
message: "행사 정보를 불러오는 중에 오류가 발생했습니다.", | ||
}; | ||
|
||
return ( | ||
<ErrorFallback | ||
error={error} | ||
resetErrorBoundary={() => { | ||
window.location.reload(); | ||
}} | ||
/> | ||
); | ||
}; | ||
export default DetailPageError; |
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,4 @@ | ||
import LoadingSpinner from "@/components/common/LoadingSpinner"; | ||
|
||
const DetailLoading = () => <LoadingSpinner />; | ||
export default DetailLoading; |
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,6 @@ | ||
import LoadingSpinner from "@/components/common/LoadingSpinner"; | ||
|
||
const MainLoading = () => { | ||
return <LoadingSpinner />; | ||
}; | ||
export default MainLoading; |
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
Oops, something went wrong.