diff --git a/actions/fetchProjectsData.ts b/actions/fetchProjectsData.ts index 94dfb4ef..76743b87 100644 --- a/actions/fetchProjectsData.ts +++ b/actions/fetchProjectsData.ts @@ -2,6 +2,7 @@ import { IProjectsDataResponse, + Project, ProjectPaginationFilter, } from '@/types/project'; @@ -17,23 +18,20 @@ async function fetchProjectsData({ page = 1, limit = 100, filter = ProjectPaginationFilter.ALL, -}: ProjectPaginationRequest) { +}: ProjectPaginationRequest): Promise { + const response = await fetch(PROJECT_API_ENDPOINT, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ page, limit, filter }), + }); + // fetch from endpoint POST with page, limit, filter as IProjectsDataResponse - const { projects, total, languages, pageLanguages, timestamp } = await fetch( - PROJECT_API_ENDPOINT, - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ page, limit, filter }), - } - ).then(res => res.json() as Promise); + const { projects, total, languages, pageLanguages, timestamp } = + await response.json(); - return { - projects: projects, - pageLanguages, - }; + return { projects, total, languages, pageLanguages, timestamp }; } export default fetchProjectsData; diff --git a/app/[locale]/members/page.tsx b/app/[locale]/members/page.tsx index 96f5eb97..53097a2b 100644 --- a/app/[locale]/members/page.tsx +++ b/app/[locale]/members/page.tsx @@ -6,7 +6,7 @@ import { MembersList } from '@/components/Members/MembersLIst/MembersList'; import { Member } from '@/types'; import { fetchFilteredMemebers } from '@/actions/fetchFilteredMemebers'; import { useTranslations } from 'next-intl'; -import useTypedLocale from '@/hooks/useTypedLocale'; +import useTextDirection from '@/hooks/useTextDirection'; const Magnifier: React.FC> = props => { return ( @@ -34,10 +34,10 @@ const Magnifier: React.FC> = props => { const WelcomeMessage = () => { const t = useTranslations('Members'); - const localLang = useTypedLocale(); + const direction = useTextDirection(); return (
diff --git a/app/[locale]/projects/page.tsx b/app/[locale]/projects/page.tsx index a73e0958..28001d2a 100644 --- a/app/[locale]/projects/page.tsx +++ b/app/[locale]/projects/page.tsx @@ -74,7 +74,6 @@ const ProjectsPage = () => { }; const debouncedFetchProjectsData = useCallback(async () => { - console.log('first', Date.now()); setLoading(true); try { const { projects, pageLanguages } = await fetchProjectsData({ @@ -84,7 +83,7 @@ const ProjectsPage = () => { }); setProjects( - projects.filter(p => + projects.filter((p: Project) => p.item.data.repository.name .toLocaleLowerCase() .trim() @@ -93,7 +92,7 @@ const ProjectsPage = () => { ); const newTags: ProjectFilter[] = []; - pageLanguages.forEach(lang => { + pageLanguages.forEach((lang: string) => { newTags.push({ name: lang, isActive: true }); }); setTags(newTags); diff --git a/components/BeOurFriends/BeOurFriends.tsx b/components/BeOurFriends/BeOurFriends.tsx index 3d842883..d5876012 100644 --- a/components/BeOurFriends/BeOurFriends.tsx +++ b/components/BeOurFriends/BeOurFriends.tsx @@ -21,7 +21,7 @@ const variants = { }; const BeOurFriends = () => { - const t = useTranslations('components.home.beOurFriends'); + const t = useTranslations('Components.home.beOurFriends'); const localLang = useLocale(); const direction = localLang == 'he' ? 'rtl' : 'ltr';