From 7e7a010d5e8b0362f2265ccb217e85924c4df152 Mon Sep 17 00:00:00 2001 From: Sonny Date: Mon, 4 Aug 2025 19:49:28 +0200 Subject: [PATCH] fix: page transition --- inertia/layouts/_base_layout.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/inertia/layouts/_base_layout.tsx b/inertia/layouts/_base_layout.tsx index 105596b..982660b 100644 --- a/inertia/layouts/_base_layout.tsx +++ b/inertia/layouts/_base_layout.tsx @@ -1,22 +1,17 @@ -import { router, usePage } from '@inertiajs/react'; -import { ColorSchemeScript, createTheme, MantineProvider } from '@mantine/core'; +import { router } from '@inertiajs/react'; +import { ColorSchemeScript, MantineProvider } from '@mantine/core'; +import '@mantine/core/styles.css'; +import '@mantine/spotlight/styles.css'; import dayjs from 'dayjs'; import { ReactNode, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; -import { InertiaPage } from '~/types/inertia'; - -import '@mantine/core/styles.css'; -import '@mantine/spotlight/styles.css'; import '../styles/index.css'; -const theme = createTheme({}); const TRANSITION_IN_CLASS = '__transition_fadeIn'; const TRANSITION_OUT_CLASS = '__transition_fadeOut'; export default function BaseLayout({ children }: { children: ReactNode }) { const { i18n } = useTranslation(); - const { language } = usePage().props; - i18n.changeLanguage(language); dayjs.locale(i18n.language); const findAppElement = () => document.getElementById('app'); @@ -34,7 +29,6 @@ export default function BaseLayout({ children }: { children: ReactNode }) { useEffect(() => { const currentLocation = new URL(window.location.href); - flipClass(TRANSITION_IN_CLASS, TRANSITION_OUT_CLASS); const removeStartEventListener = router.on( 'start', @@ -58,7 +52,7 @@ export default function BaseLayout({ children }: { children: ReactNode }) { return ( <> - {children} + {children} ); }