diff --git a/src/App.tsx b/src/App.tsx index a493194..b0dd34b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -70,7 +70,6 @@ const Badge = () => { const App: React.FC = () => { const [cycles, setCycles] = useState([]); const [theme, setTheme] = useState("basic"); - const [isLanguageModal, setIsLanguageModal] = useState(false); const { t, i18n } = useTranslation(); const [needUpdate, setNeedUpdate] = useState(false); @@ -162,10 +161,7 @@ const App: React.FC = () => { exact path="/peri/" > - + void; - - isLanguageModal: boolean; - setIsLanguageModal: (newIsOpen: boolean) => void; } const Welcome = (props: PropsWelcomeModal) => { diff --git a/src/pages/TabHome.tsx b/src/pages/TabHome.tsx index 5d54e03..3700e20 100644 --- a/src/pages/TabHome.tsx +++ b/src/pages/TabHome.tsx @@ -286,12 +286,7 @@ const EditCalendar = (props: SelectCalendarProps) => { ); }; -interface HomeProps { - isLanguageModal: boolean; - setIsLanguageModal: (newIsOpen: boolean) => void; -} - -const TabHome = (props: HomeProps) => { +const TabHome = () => { const theme = useContext(ThemeContext).theme; const [isInfoModal, setIsInfoModal] = useState(false); @@ -309,9 +304,8 @@ const TabHome = (props: HomeProps) => { useEffect(() => { const backButtonHandler = () => { - if (isInfoModal || props.isLanguageModal) { + if (isInfoModal) { setIsInfoModal(false); - props.setIsLanguageModal(false); router.push("/home"); return; } @@ -326,7 +320,7 @@ const TabHome = (props: HomeProps) => { return () => { document.removeEventListener("ionBackButton", backButtonHandler); }; - }, [router, isInfoModal, props]); + }, [router, isInfoModal]); const { t } = useTranslation(); const { cycles, updateCycles } = useContext(CyclesContext); @@ -346,8 +340,6 @@ const TabHome = (props: HomeProps) => {
diff --git a/src/tests/TabHome.test.tsx b/src/tests/TabHome.test.tsx index 8e2374d..556665e 100644 --- a/src/tests/TabHome.test.tsx +++ b/src/tests/TabHome.test.tsx @@ -2,11 +2,6 @@ import { render } from "@testing-library/react"; import TabHome from "../pages/TabHome"; test("renders without crashing", () => { - const { baseElement } = render( - {}} - />, - ); + const { baseElement } = render(); expect(baseElement).toBeDefined(); }); diff --git a/src/tests/WelcomeModal.test.tsx b/src/tests/WelcomeModal.test.tsx index d1d31dd..dbf724c 100644 --- a/src/tests/WelcomeModal.test.tsx +++ b/src/tests/WelcomeModal.test.tsx @@ -6,8 +6,6 @@ test("renders without crashing", () => { {}} - isLanguageModal - setIsLanguageModal={() => {}} />, ); expect(baseElement).toBeDefined();