refactor: enforce semantic values and numeric lint rules
This commit is contained in:
@@ -3,6 +3,8 @@ import * as m from "motion/react-m";
|
||||
import type { FC, PropsWithChildren } from "react";
|
||||
import { useLocation } from "react-router";
|
||||
|
||||
const TRANSITION_DURATION_SECONDS = 0.2;
|
||||
|
||||
const RouteTransition: FC<PropsWithChildren> = (props) => {
|
||||
const { children } = props;
|
||||
const { pathname } = useLocation();
|
||||
@@ -14,7 +16,10 @@ const RouteTransition: FC<PropsWithChildren> = (props) => {
|
||||
key={pathname}
|
||||
initial={reduceMotion ? false : { opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: reduceMotion ? 0 : 0.2, ease: "easeOut" }}
|
||||
transition={{
|
||||
duration: reduceMotion ? 0 : TRANSITION_DURATION_SECONDS,
|
||||
ease: "easeOut",
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</m.div>
|
||||
|
||||
Reference in New Issue
Block a user