Skip to content

Commit

Permalink
feat(client): starting on admin feed
Browse files Browse the repository at this point in the history
  • Loading branch information
junglesub committed Oct 25, 2024
1 parent cef72e7 commit e1be2b4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
43 changes: 43 additions & 0 deletions src/main/front/src/pages/admin/AdminFeed.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import InfiniteScroll from "react-infinite-scroller";
import AdminPage from "./AdminPage";
import FeedCard from "../../components/FeedCard";
import useLoadData from "../../hooks/useLoadData";
import { Box, Paper } from "@mui/material";

function AdminFeed() {
const [allFeeds, hasMore, loadData] = useLoadData();

return (
<AdminPage>
<InfiniteScroll
loadMore={loadData}
hasMore={hasMore}
loader={Array(1)
.fill()
.map((_, index) => (
<FeedCard key={index} loading />
))}
>
{allFeeds.map((item) => (
// <FeedItemNew
// key={item.id}
// item={item}
// setAllSeenFeedId={setAllSeenFeedId}
// />
<Box
sx={{
display: "flex",
}}
>
<Box sx={{ flexGrow: 1, maxWidth: 500 }}>
<FeedCard key={item.id} item={item} />
</Box>
<Paper sx={{ flexGrow: 1, my: "16px", ml: 2 }}>Hello!</Paper>
</Box>
))}
</InfiniteScroll>
</AdminPage>
);
}

export default AdminFeed;
3 changes: 2 additions & 1 deletion src/main/front/src/pages/admin/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import FeedIcon from "@mui/icons-material/Feed";
import InsertDriveFileIcon from "@mui/icons-material/InsertDriveFile";

import UsersTable from "./UsersTable";
import AdminFeed from "./AdminFeed";

export const ADMINMENU = [
{
Expand All @@ -15,7 +16,7 @@ export const ADMINMENU = [
title: "게시글 관리",
icon: <FeedIcon />,
id: "posts",
comp: UsersTable,
comp: AdminFeed,
},
{
title: "파일 관리",
Expand Down

0 comments on commit e1be2b4

Please sign in to comment.