-
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.
- Loading branch information
1 parent
f7fbb5a
commit 7d10e31
Showing
6 changed files
with
87 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use client"; | ||
import { AugmentedGetPostListResponse } from "@/queries/post/useGetPostListInfiniteQuery"; | ||
import PostCardList from "@/components/post/PostCardList"; | ||
|
||
import CustomContainer from "@/components/layout/CustomContainer"; | ||
import { useState } from "react"; | ||
import CustomToggleButtonGroup from "@/components/CustomToggleButtonGroup"; | ||
|
||
type Props = { | ||
initialData: AugmentedGetPostListResponse; | ||
}; | ||
|
||
const MainPagePostList = ({ initialData }: Props) => { | ||
const selectableList = ["전체 캐스크", "인기"]; | ||
const [currentView, setCurrentView] = useState(selectableList[0]); | ||
|
||
return ( | ||
<> | ||
<CustomToggleButtonGroup | ||
value={selectableList} | ||
onChange={setCurrentView} | ||
sx={{ position: "fixed", top: 0, left: 0, right: 0,zIndex:1 }} | ||
/> | ||
<CustomContainer mt={5}> | ||
{currentView==="전체 캐스크"&&<PostCardList initialData={initialData} />} | ||
{currentView==="인기"&&<PostCardList sort="likeCount"/>} | ||
</CustomContainer> | ||
</> | ||
); | ||
}; | ||
|
||
export default MainPagePostList; |
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