diff --git a/inertia/components/common/mantine_theme_switcher.tsx b/inertia/components/common/mantine_theme_switcher.tsx index 84ada9d..654c8c5 100644 --- a/inertia/components/common/mantine_theme_switcher.tsx +++ b/inertia/components/common/mantine_theme_switcher.tsx @@ -1,11 +1,11 @@ -import { useMantineColorScheme, ActionIcon } from '@mantine/core'; -import { TbSun, TbMoonStars } from 'react-icons/tb'; +import { ActionIcon, useMantineColorScheme } from '@mantine/core'; +import { TbMoonStars, TbSun } from 'react-icons/tb'; export function MantineThemeSwitcher() { const { colorScheme, toggleColorScheme } = useMantineColorScheme(); return ( toggleColorScheme()} size="lg" diff --git a/inertia/components/footer/mantine_footer.tsx b/inertia/components/footer/mantine_footer.tsx index b73b7a9..ecbafc6 100644 --- a/inertia/components/footer/mantine_footer.tsx +++ b/inertia/components/footer/mantine_footer.tsx @@ -1,7 +1,7 @@ import PATHS from '#constants/paths'; import { Link } from '@inertiajs/react'; import { route } from '@izzyjs/route/client'; -import { Anchor, Group, Image } from '@mantine/core'; +import { Anchor, Group, Image, Text } from '@mantine/core'; import { useTranslation } from 'react-i18next'; import ExternalLink from '~/components/common/external_link'; import packageJson from '../../../package.json'; @@ -33,13 +33,13 @@ export function MantineFooter() {
MyLinks's logo - - {t('footer.made_by')}{' '} - + + {t('footer.made_by')}{' '} + Sonny {' • '} - + {packageJson.version} diff --git a/inertia/components/layouts/mantine/_mantine_base_layout.tsx b/inertia/components/layouts/mantine/_mantine_base_layout.tsx index 4f7ba2c..81146b6 100644 --- a/inertia/components/layouts/mantine/_mantine_base_layout.tsx +++ b/inertia/components/layouts/mantine/_mantine_base_layout.tsx @@ -1,6 +1,7 @@ +import { router } from '@inertiajs/react'; import { ColorSchemeScript, createTheme, MantineProvider } from '@mantine/core'; import dayjs from 'dayjs'; -import { ReactNode } from 'react'; +import { ReactNode, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import '@mantine/core/styles.css'; @@ -8,10 +9,33 @@ 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(); dayjs.locale(i18n.language); + + const findAppElement = () => document.getElementById('app'); + + const flipClass = (addClass: string, removeClass: string) => { + const appElement = findAppElement(); + if (appElement) { + appElement.classList.add(addClass); + appElement.classList.remove(removeClass); + } + }; + + useEffect(() => { + flipClass(TRANSITION_IN_CLASS, TRANSITION_OUT_CLASS); + router.on('start', () => + flipClass(TRANSITION_OUT_CLASS, TRANSITION_IN_CLASS) + ); + router.on('finish', () => + flipClass(TRANSITION_IN_CLASS, TRANSITION_OUT_CLASS) + ); + }, []); + return ( <> diff --git a/inertia/components/layouts/mantine/mantine_content_layout.tsx b/inertia/components/layouts/mantine/mantine_content_layout.tsx index 8439def..18c5bee 100644 --- a/inertia/components/layouts/mantine/mantine_content_layout.tsx +++ b/inertia/components/layouts/mantine/mantine_content_layout.tsx @@ -4,27 +4,25 @@ import { MantineFooter } from '~/components/footer/mantine_footer'; import BaseLayout from '~/components/layouts/mantine/_mantine_base_layout'; import MantineNavbar from '~/components/navbar/mantine_navbar'; -function MantineContentLayout({ children }: PropsWithChildren) { - return ( - ( + + +
- -
- {children} -
- - - ); -} + {children} +
+ +
+); const LayoutWrapper = ({ children }: PropsWithChildren) => ( diff --git a/inertia/components/navbar/mantine_navbar.tsx b/inertia/components/navbar/mantine_navbar.tsx index 751b104..19b052e 100644 --- a/inertia/components/navbar/mantine_navbar.tsx +++ b/inertia/components/navbar/mantine_navbar.tsx @@ -41,7 +41,7 @@ export default function MantineNavbar() {
- +