Skip to content

Commit

Permalink
New : 인기 게시글 불러오기 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jobkaeHenry committed Jan 5, 2024
1 parent 42ca266 commit ab021b3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/src/components/post/MainPagePostList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import PostCardList from "@/components/post/PostCardList";
import CustomContainer from "@/components/layout/CustomContainer";
import { useState } from "react";
import CustomToggleButtonGroup from "@/components/CustomToggleButtonGroup";
import PopularPostCardList from "./PopularPostCardList";

type Props = {
initialData: AugmentedGetPostListResponse;
Expand All @@ -19,11 +20,13 @@ const MainPagePostList = ({ initialData }: Props) => {
<CustomToggleButtonGroup
value={selectableList}
onChange={setCurrentView}
sx={{ position: "fixed", top: 0, left: 0, right: 0,zIndex:1 }}
sx={{ position: "fixed", top: 0, left: 0, right: 0, zIndex: 1 }}
/>
<CustomContainer mt={5}>
{currentView==="전체 캐스크"&&<PostCardList initialData={initialData} />}
{currentView==="인기"&&<PostCardList sort="likeCount"/>}
{currentView === "전체 캐스크" && (
<PostCardList initialData={initialData} />
)}
{currentView === "인기" && <PopularPostCardList />}
</CustomContainer>
</>
);
Expand Down

0 comments on commit ab021b3

Please sign in to comment.