diff --git a/src/pages/Coaches/index.tsx b/src/pages/Coaches/index.tsx index 5b72296..196ae37 100644 --- a/src/pages/Coaches/index.tsx +++ b/src/pages/Coaches/index.tsx @@ -77,7 +77,7 @@ const CoachesPage: React.FC = () => { title={t('Navbar.coaches')} newButtonValue={t('coach.new-coach')} onClickNew={() => setNewCoach(true)} - onClickDownload={() => handleDownloadJSON(coaches, t('Navbar.coaches').toLowerCase().replaceAll(' ', '-'))} + onClickDownload={() => handleDownloadJSON(coaches, t('Navbar.coaches').toLowerCase().replace(' ', '-'))} /> { const { t } = useTranslation(); @@ -56,15 +56,12 @@ const CompetenciesPage: React.FC = () => { return ( setNewCompetence(true)} onClickDownload={() => - handleDownloadJSON( - competencies, - t("Navbar.teaching-practices").toLowerCase().replaceAll(" ", "-") - ) + handleDownloadJSON(competencies, t('Navbar.teaching-practices').toLowerCase().replace(' ', '-')) } /> @@ -77,7 +74,7 @@ const CompetenciesPage: React.FC = () => { /> {isLoadingList ? ( -
+
) : ( diff --git a/src/pages/Schools/index.tsx b/src/pages/Schools/index.tsx index 2881101..b899cc7 100644 --- a/src/pages/Schools/index.tsx +++ b/src/pages/Schools/index.tsx @@ -1,6 +1,6 @@ -import Loader from "@/components/Base/Loader"; -import SchoolService from "@/services/school"; -import { ISchool } from "@/types"; +import Loader from '@/components/Base/Loader'; +import SchoolService from '@/services/school'; +import { ISchool } from '@/types'; import { Box, Button, @@ -12,13 +12,13 @@ import { ModalFooter, ModalHeader, ModalOverlay, -} from "@chakra-ui/react"; -import { useEffect, useState } from "react"; -import SchoolList from "./SchoolList"; -import HeaderPage from "@/components/HeaderPage"; -import { useTranslation } from "react-i18next"; -import SchoolForm from "./SchoolForm"; -import handleDownloadJSON from "@/common/download"; +} from '@chakra-ui/react'; +import { useEffect, useState } from 'react'; +import SchoolList from './SchoolList'; +import HeaderPage from '@/components/HeaderPage'; +import { useTranslation } from 'react-i18next'; +import SchoolForm from './SchoolForm'; +import handleDownloadJSON from '@/common/download'; const SchoolsPage: React.FC = () => { const { t } = useTranslation(); @@ -60,8 +60,7 @@ const SchoolsPage: React.FC = () => { const deleteSchool = async () => { setIsLoadingDelete(true); - if (schoolToDelete) - await SchoolService.DeleteSchool(schoolToDelete?.id || ""); + if (schoolToDelete) await SchoolService.DeleteSchool(schoolToDelete?.id || ''); setIsLoadingDelete(false); onCloseDeleteModal(); loadSchools(); @@ -74,16 +73,11 @@ const SchoolsPage: React.FC = () => { return ( setNewSchool(true)} - onClickDownload={() => - handleDownloadJSON( - schools, - t("Navbar.schools").toLowerCase().replaceAll(" ", "-") - ) - } + onClickDownload={() => handleDownloadJSON(schools, t('Navbar.schools').toLowerCase().replace(' ', '-'))} /> { isOpen={!!schoolToEdit || newSchool} /> {isLoadingList ? ( -
+
) : ( - + )} @@ -112,11 +102,7 @@ const SchoolsPage: React.FC = () => { - diff --git a/src/pages/Sync/index.tsx b/src/pages/Sync/index.tsx index 26c4f53..4046bba 100644 --- a/src/pages/Sync/index.tsx +++ b/src/pages/Sync/index.tsx @@ -1,12 +1,12 @@ -import Loader from "@/components/Base/Loader"; -import SyncService from "@/services/sync"; -import { ISync } from "@/types"; -import { Box, Center } from "@chakra-ui/react"; -import { useEffect, useState } from "react"; -import SyncList from "./SyncList"; -import { useTranslation } from "react-i18next"; -import HeaderPage from "@/components/HeaderPage"; -import handleDownloadJSON from "@/common/download"; +import Loader from '@/components/Base/Loader'; +import SyncService from '@/services/sync'; +import { ISync } from '@/types'; +import { Box, Center } from '@chakra-ui/react'; +import { useEffect, useState } from 'react'; +import SyncList from './SyncList'; +import { useTranslation } from 'react-i18next'; +import HeaderPage from '@/components/HeaderPage'; +import handleDownloadJSON from '@/common/download'; const SyncsPage: React.FC = () => { const { t } = useTranslation(); @@ -27,17 +27,12 @@ const SyncsPage: React.FC = () => { return ( - handleDownloadJSON( - syncs, - t("Navbar.syncs").toLowerCase().replaceAll(" ", "-") - ) - } + title={t('Navbar.syncs')} + subtitle={t('Navbar.data')} + onClickDownload={() => handleDownloadJSON(syncs, t('Navbar.syncs').toLowerCase().replace(' ', '-'))} /> {isLoadingList ? ( -
+
) : ( diff --git a/src/pages/Teacher/index.tsx b/src/pages/Teacher/index.tsx index 95df58d..4d49899 100644 --- a/src/pages/Teacher/index.tsx +++ b/src/pages/Teacher/index.tsx @@ -80,7 +80,7 @@ const TeachersPage: React.FC = () => { subtitle={t('Navbar.data')} newButtonValue={t('teacher.new-teacher')} onClickNew={() => setNewTeacher(true)} - onClickDownload={() => handleDownloadJSON(teachers, t('Navbar.teachers').toLowerCase().replaceAll(' ', '-'))} + onClickDownload={() => handleDownloadJSON(teachers, t('Navbar.teachers').toLowerCase().replace(' ', '-'))} />