Skip to content

Commit

Permalink
[fix] 스타일오류, 문서 오류 등 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
suu3 committed Feb 29, 2024
1 parent 14937c8 commit a7f818f
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion gatsby-browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ export const shouldUpdateScroll = ({
// window.setTimeout(() => window.scrollTo(...savedPosition), TRANSITION_DELAY)
// }

return false
return true
}
40 changes: 20 additions & 20 deletions src/components/@layout/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ const Navigation = () => {
const [showNavigation, setShowNavigation] = useState(true)
const [prevScrollPos, setPrevScrollPos] = useState(0)

useEffect(() => {
const handleScroll = throttle(() => {
const currentScrollPos = window.scrollY
// useEffect(() => {
// const handleScroll = throttle(() => {
// const currentScrollPos = window.scrollY

if (prevScrollPos > currentScrollPos) {
setShowNavigation(true)
} else {
setShowNavigation(false)
}
// if (prevScrollPos > currentScrollPos) {
// setShowNavigation(true)
// } else {
// setShowNavigation(false)
// }

setPrevScrollPos(currentScrollPos)
}, 300)
// setPrevScrollPos(currentScrollPos)
// }, 300)

if (typeof window !== "undefined") {
setPrevScrollPos(window.scrollY)
window.addEventListener("scroll", handleScroll)
}
// if (typeof window !== "undefined") {
// setPrevScrollPos(window.scrollY)
// window.addEventListener("scroll", handleScroll)
// }

return () => {
if (typeof window !== "undefined") {
window.removeEventListener("scroll", handleScroll)
}
}
}, [prevScrollPos])
// return () => {
// if (typeof window !== "undefined") {
// window.removeEventListener("scroll", handleScroll)
// }
// }
// }, [prevScrollPos])

return (
<nav className={clsx(wrapper, !showNavigation && hide)}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/@layout/post-list-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const PostListTemplate = ({ data, location, pageContext }) => {
<Pagination
onPageChange={handlePageChange}
currentPage={currentPage}
totalPages={totalCount / POST_PER_PAGE + 1}
totalPages={Number((totalCount / POST_PER_PAGE + 1).toFixed(0))}
/>
{/* <Pagination
itemRender={textItemRender}
Expand Down
1 change: 1 addition & 0 deletions src/components/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Pagination = ({
}: PaginationProps) => {
const isFirstPage = currentPage === 1
const isLastPage = currentPage === totalPages
console.log(currentPage, totalPages)
const ellipsis = "..."
const halfPagesToShow = Math.floor(pagesToShow / 2) // 5 => 2, 6 => 3

Expand Down
5 changes: 2 additions & 3 deletions src/components/table-contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ interface TableContentsProps {
}

const TableContents = ({ content = "" }: TableContentsProps) => {

if(!content) return null;
if (!content) return null
return (
<aside className={wrapper}>
<div className={inner}>
<header className={header}>Index</header>

<div dangerouslySetInnerHTML={{ __html: content }} />}
<div dangerouslySetInnerHTML={{ __html: content }} />
</div>
</aside>
)
Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ a:focus {
/* background-color: var(--background-color); */
margin: var(--spacing-0) auto;
max-width: var(--maxWidth-wrapper);
padding: var(--spacing-20) 0 var(--spacing-10);
padding: var(--spacing-16) 0 var(--spacing-10);

position: relative;
}
Expand Down

0 comments on commit a7f818f

Please sign in to comment.