feat: animate page transitions with Motion

This commit is contained in:
2026-09-09 19:00:24 +03:00
parent 91eaeb5661
commit c906dfa2e2
4 changed files with 93 additions and 1 deletions
+6 -1
View File
@@ -2,6 +2,7 @@ import { Container, Group, Skeleton, Stack } from "@mantine/core";
import type { FC, PropsWithChildren } from "react";
import { Suspense } from "react";
import { useTranslation } from "react-i18next";
import { RouteTransition } from "./RouteTransition";
type RouteSkeletonVariant = "auth" | "content" | "shell";
type LazyPageProps = PropsWithChildren<{ variant: RouteSkeletonVariant }>;
@@ -60,7 +61,11 @@ const LazyPage: FC<LazyPageProps> = (props) => {
const { children, variant } = props;
return (
<Suspense fallback={<RouteSkeleton variant={variant} />}>
{children}
{variant === "shell" ? (
children
) : (
<RouteTransition>{children}</RouteTransition>
)}
</Suspense>
);
};