Avoid task page hidden animation on tab navigation

This commit is contained in:
Codex Agent
2026-01-14 11:25:43 +01:00
parent 6f49564e1b
commit 99a02b991c
3 changed files with 37 additions and 38 deletions

View File

@@ -56,3 +56,17 @@ export function getMotionContainerProps(enabled: boolean, variants: Variants) {
export function getMotionItemProps(enabled: boolean, variants: Variants) {
return enabled ? { variants } : {};
}
export function getMotionContainerPropsForNavigation(
enabled: boolean,
variants: Variants,
navigationType: 'POP' | 'PUSH' | 'REPLACE'
) {
if (!enabled) {
return { initial: false } as const;
}
const initial = navigationType === 'POP' ? 'hidden' : false;
return { variants, initial, animate: 'show' } as const;
}