diff --git a/eslint.config.ts b/eslint.config.ts index 78938a75e..59f117624 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -357,6 +357,7 @@ const eslintConfig = defineConfig([ 'no-sequences': 'error', // disallow usage of expressions in statement position 'no-unused-expressions': 'error', + '@typescript-eslint/no-unused-vars': 'error', // disallow unused labels 'no-unused-labels': 'error', // disallow usage of configurable warning terms in comments: e.g. todo diff --git a/src/app/_components/Company/CompanyListRenderer.tsx b/src/app/_components/Company/CompanyListRenderer.tsx index 70f39b9eb..7096aef7b 100644 --- a/src/app/_components/Company/CompanyListRenderer.tsx +++ b/src/app/_components/Company/CompanyListRenderer.tsx @@ -1,7 +1,6 @@ import Company from './Company' import type { SessionMaybeUser } from '@/auth/session/Session' import type { CompanyExpanded } from '@/services/career/companies/types' -import { v4 } from 'uuid' /** * Used to render schools server side and client side in consistent way @@ -19,4 +18,4 @@ export const companyListRenderer = ({ disableEditing?: boolean // eslint-disable-next-line react/display-name }) => (company: CompanyExpanded) => - + diff --git a/src/app/_components/NavBar/navDef.ts b/src/app/_components/NavBar/navDef.ts index e06e5e9a2..9fc977755 100644 --- a/src/app/_components/NavBar/navDef.ts +++ b/src/app/_components/NavBar/navDef.ts @@ -4,8 +4,6 @@ import { faGamepad, faBook, - faPoo, - faShoppingCart, faComment, faCamera, faCircleInfo, @@ -17,7 +15,6 @@ import { faBriefcase, faGraduationCap, faTools, - faChartLine, faSignature, faSchool, faHouseChimneyWindow, diff --git a/src/app/_components/PagingWrappers/EndlessScroll.tsx b/src/app/_components/PagingWrappers/EndlessScroll.tsx index a5fe6f6ae..343fdf85e 100644 --- a/src/app/_components/PagingWrappers/EndlessScroll.tsx +++ b/src/app/_components/PagingWrappers/EndlessScroll.tsx @@ -28,19 +28,21 @@ export default function EndlessScroll { - if (context.state.allLoaded) return + const loadMoreCallback = useCallback(async () => { if (!inView) return - await context.loadMore() - }, [context, inView]) + await loadMore() + }, [loadMore, inView]) useEffect(() => { - loadMore() - }, [inView, loadMore]) + loadMoreCallback() + }, [inView, loadMoreCallback]) const renderedPageData = useMemo(() => context.state.data.map((dataEntry, i) => { @@ -67,14 +69,26 @@ export default function EndlessScroll { if (timerRef.current) clearTimeout(timerRef.current) } - }, [context.state.allLoaded]) + }, [state]) return ( <> {renderedPageData} - Ingen flere å laste inn - + { + loading ? ( + Laster inn flere... + ) : ( + <> + + Ingen flere å laste inn + + + + ) + } ) diff --git a/src/app/_components/User/UserList/UserList.tsx b/src/app/_components/User/UserList/UserList.tsx index 7112be8d2..264e1608a 100644 --- a/src/app/_components/User/UserList/UserList.tsx +++ b/src/app/_components/User/UserList/UserList.tsx @@ -10,7 +10,6 @@ import { UserSelectionContext } from '@/contexts/UserSelection' import { readGroupsForPageFilteringAction } from '@/services/users/actions' import { useContext, useEffect, useState } from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { v4 } from 'uuid' import { faCheck } from '@fortawesome/free-solid-svg-icons' import type { UserPagingReturn } from '@/services/users/types' import type { ChangeEvent, ReactNode } from 'react' @@ -265,7 +264,7 @@ export default function UserList({ ( - + { usersSelection &&