File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed
src/apps/talent-search/src/routes/search-results-page Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -31,27 +31,27 @@ const SearchResultsPage: FC = () => {
31
31
const paginatedMatches = matches . slice ( 0 , currentPage * itemsPerPage )
32
32
33
33
useEffect ( ( ) => {
34
- const handleScroll = ( ) => {
35
- const scrollY = window . scrollY
36
- const visibleHeight = window . innerHeight
37
- const fullHeight = document . body . scrollHeight
38
-
39
- if ( scrollY + visibleHeight >= fullHeight - 100 ) {
34
+ const handleScroll : ( ) => void = ( ) => {
35
+ const scrollY = window . scrollY
36
+ const visibleHeight = window . innerHeight
37
+ const fullHeight = document . body . scrollHeight
38
+
39
+ if ( scrollY + visibleHeight >= fullHeight - 100 ) {
40
40
// Scroll near bottom
41
- setCurrentPage ( prev => {
42
- const maxPages = Math . ceil ( matches . length / itemsPerPage )
43
- return prev < maxPages ? prev + 1 : prev
44
- } )
45
- }
41
+ setCurrentPage ( prev => {
42
+ const maxPages = Math . ceil ( matches . length / itemsPerPage )
43
+ return prev < maxPages ? prev + 1 : prev
44
+ } )
45
+ }
46
46
}
47
-
47
+
48
48
window . addEventListener ( 'scroll' , handleScroll )
49
49
return ( ) => window . removeEventListener ( 'scroll' , handleScroll )
50
- } , [ matches ] )
50
+ } , [ matches ] )
51
51
52
- useEffect ( ( ) => {
52
+ useEffect ( ( ) => {
53
53
setCurrentPage ( 1 )
54
- } , [ skills , matches ] )
54
+ } , [ skills , matches ] )
55
55
56
56
const toggleSkillsModal = useCallback ( ( ) => setShowSkillsModal ( s => ! s ) , [ ] )
57
57
You can’t perform that action at this time.
0 commit comments