fix: pagiantor bug

This commit is contained in:
원더 2021-01-25 21:45:04 +09:00
parent 448343335d
commit dc58e75da4

View File

@ -1,6 +1,6 @@
import Link from 'next/link' import Link from 'next/link'
const Paginator = ({ currentPage, totalPage }:PaginatorProps):JSX.Element => { const Paginator = ({ currentPage, totalPage }:PaginatorProps):JSX.Element => {
const pages = [1, currentPage - 1, currentPage, currentPage + 1, totalPage ] const pages = [1, currentPage === 1 ? 2 : currentPage - 1, currentPage === 1 ? 3 : currentPage, currentPage + 1, totalPage ]
return <div className='flex flex-col items-center my-12 text-center justify-center'> return <div className='flex flex-col items-center my-12 text-center justify-center'>
<div className='flex text-gray-700 dark:text-gray-400'> <div className='flex text-gray-700 dark:text-gray-400'>
<Link href={{ pathname: '/list/votes', query: { page: currentPage - 1} }}> <Link href={{ pathname: '/list/votes', query: { page: currentPage - 1} }}>