Skip to content

Commit

Permalink
chore: 가독성을 위한 변수명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhyojeong committed Jan 23, 2024
1 parent fae61bf commit 00a4527
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
9 changes: 4 additions & 5 deletions src/pages/categories/[categoryCode].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { PostSection, ResultHeader } from '@components'
import type { SortOptionCodes, TradeTypeCodes } from '@types'
import { find, removeNullish, toQueryString } from '@utils'

const DEFAULT_POST_PAGE_NUMBER = 8
const DEFAULT_PER_PAGE = 8
// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다
const POSTS_COUNT_MOCK = 10

type CategoriesProps = {
category?: string
Expand All @@ -33,9 +35,6 @@ export const getServerSideProps: GetServerSideProps<CategoriesProps> = async ({
}
})

// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다
const POSTS_COUNT_MOCK = 10

const Categories: NextPage = ({
category,
sort,
Expand Down Expand Up @@ -65,7 +64,7 @@ const Categories: NextPage = ({

const infinitePosts = useGetInfinitePostsQuery({
lastId: null,
limit: DEFAULT_POST_PAGE_NUMBER,
limit: DEFAULT_PER_PAGE,
...searchParams
})

Expand Down
11 changes: 6 additions & 5 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@ import { ProductList } from '../components/home/ProductList'
import { useGetInfinitePostsQuery } from '@apis/post'
import { CategorySlider, HomeBanner } from '@components'

const DEFAULT_PER_PAGE = 8
// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다
const POSTS_COUNTS_MOCK = 10

const Home: NextPage = () => {
const {
data: postList,
fetchNextPage,
hasNextPage
} = useGetInfinitePostsQuery({
lastId: null,
limit: 8
limit: DEFAULT_PER_PAGE
})
const router = useRouter()

// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다
const postsCount = 10

return (
<Layout>
<HomeWrapper>
<HomeBanner />
<CategorySlider />
<ProductTitle>새로운 상품</ProductTitle>
{postsCount > 0 ? (
{POSTS_COUNTS_MOCK > 0 ? (
<ProductList
fetchNextPage={fetchNextPage}
hasNextPage={hasNextPage}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ResultHeader, PostSection } from '@components'
import type { SortOptionCodes, TradeTypeCodes } from '@types'
import { toQueryString, removeNullish } from '@utils'

const DEFAULT_POST_PAGE_NUMBER = 8
const DEFAULT_PER_PAGE = 8
// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다
const POST_COUNT_MOCK = 10

Expand Down Expand Up @@ -64,7 +64,7 @@ const ResultPage: NextPage = ({

const infinitePosts = useGetInfinitePostsQuery({
lastId: null,
limit: DEFAULT_POST_PAGE_NUMBER,
limit: DEFAULT_PER_PAGE,
...searchParams
})

Expand Down

0 comments on commit 00a4527

Please sign in to comment.