Skip to content

Commit

Permalink
fix CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SeojinSeojin committed Nov 9, 2023
1 parent 135f0ca commit 2393648
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/views/BlogPage/hooks/useInfiniteScroll.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
import { useEffect } from 'react';
import { useEffect, useState } from 'react';
import { FetchNextPageOptions, InfiniteQueryObserverResult } from 'react-query';
import useBooleanState from '@src/hooks/useBooleanState';
import useIntersectionObserver from '@src/hooks/useIntersectionObserver';
import { BlogResponse } from '@src/lib/types/blog';

export default function useInfiniteScroll(fetchNextPage: {
(options?: FetchNextPageOptions): Promise<InfiniteQueryObserverResult<BlogResponse>>;
(): void;
}) {
const [hasObserved, setHasObserved, setHasUnObserved] = useBooleanState(false);
const [hasObserved, setHasObserved] = useState(false);

const ref = useIntersectionObserver(
async (entry, observer) => {
if (!hasObserved && entry.isIntersecting) {
fetchNextPage();
setHasObserved();
setHasObserved(true);
}

observer.unobserve(entry.target);
setHasUnObserved();
setHasObserved(false);
},
{ rootMargin: '80px' },
);

useEffect(() => {
setHasUnObserved();
setHasObserved(false);
}, []);

return { ref };
Expand Down
4 changes: 2 additions & 2 deletions src/views/RecruitPage/components/ActivityReview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function ActivityReview() {
<ArrowLeft stroke={isLeftScrollable ? 'white' : 'grey'} />
</ArrowWrapper>
<Content ref={scrollableRef}>
{/* {reviews.data.map((review) => (
{reviews.data.map((review) => (
<Link
key={review.id}
href={review.url}
Expand All @@ -66,7 +66,7 @@ export default function ActivityReview() {
</DescWrapper>
</CardWrapper>
</Link>
))} */}
))}
</Content>
<ArrowWrapper onClick={() => onClickRightButton(scrollableRef.current)}>
<ArrowRight stroke={isRightScrollable ? 'white' : 'grey'} />
Expand Down

0 comments on commit 2393648

Please sign in to comment.