refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -11,16 +11,18 @@ const RouteTransition: FC<PropsWithChildren> = (props) => {
|
||||
const { pathname } = useLocation();
|
||||
const reduceMotion = useReducedMotion();
|
||||
|
||||
const transition = {
|
||||
duration: reduceMotion ? 0 : TRANSITION_DURATION_SECONDS,
|
||||
ease: "easeOut" as const,
|
||||
};
|
||||
|
||||
return (
|
||||
<LazyMotion features={domAnimation}>
|
||||
<m.div
|
||||
animate={{ opacity: 1 }}
|
||||
initial={!reduceMotion && { opacity: 0 }}
|
||||
key={pathname}
|
||||
transition={{
|
||||
duration: reduceMotion ? 0 : TRANSITION_DURATION_SECONDS,
|
||||
ease: "easeOut",
|
||||
}}
|
||||
transition={transition}
|
||||
>
|
||||
{children}
|
||||
</m.div>
|
||||
|
||||
Reference in New Issue
Block a user