-
Notifications
You must be signed in to change notification settings - Fork 37
[남기연] sprint9 #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "Next-\uB0A8\uAE30\uC5F0-sprint9"
[남기연] sprint9 #308
Changes from 1 commit
f554999
9b6a5ca
5569432
2fab846
fba2e36
8acaf03
7cfb7c7
6becf40
a71f491
ed284bb
badd979
eac3d41
b8f1f6e
c9c3229
4e00daa
f4de0eb
38b936a
6f7bdb6
979b2ac
a0c4627
75419fb
895e82a
a09eae4
bbaa9f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,18 +4,17 @@ import BasePost from "./BasePost"; | |
| import { useEffect, useState } from "react"; | ||
| import ToggleBtn from "../../../components/ToggleBtn"; | ||
| import Link from "next/link"; | ||
| import { PostData } from "../../../types"; | ||
| import { Post } from "../../../types"; | ||
| import fetchPosts from "@/lib/fetch-posts"; | ||
|
|
||
| interface AllPostProps { | ||
| initialAllPosts: PostData[]; | ||
| initialAllPosts: Post[]; | ||
| } | ||
|
|
||
| export default function AllPosts({ initialAllPosts }: AllPostProps) { | ||
| const [postList, setPostList] = useState<PostData[]>(initialAllPosts); | ||
| const [postList, setPostList] = useState<Post[]>(initialAllPosts); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| const [orderBy, setOrderBy] = useState<"recent" | "like">("recent"); | ||
| const [filterPostList, setFilterPostList] = | ||
| useState<PostData[]>(initialAllPosts); | ||
| const [filterPostList, setFilterPostList] = useState<Post[]>(initialAllPosts); | ||
|
||
| const [searchValue, setSearchValue] = useState<string>(""); | ||
|
|
||
| const onChangeOrderBy = (orderByValue: "recent" | "like") => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우리 멘토링떄 이야기했던것처럼 list 반환타입의 경우 제네릭을 활용해서 거기에 list필드가 반환하는 값이
Post[]가 될 수 있도록 한번 해볼까요?