Skip hidden initial motion on achievements tab nav
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { Link, useParams } from 'react-router-dom';
|
import { Link, useNavigationType, useParams } from 'react-router-dom';
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
@@ -24,7 +24,7 @@ import type { LocaleCode } from '../i18n/messages';
|
|||||||
import { localizeTaskLabel } from '../lib/localizeTaskLabel';
|
import { localizeTaskLabel } from '../lib/localizeTaskLabel';
|
||||||
import { useEventData } from '../hooks/useEventData';
|
import { useEventData } from '../hooks/useEventData';
|
||||||
import { isTaskModeEnabled } from '../lib/engagement';
|
import { isTaskModeEnabled } from '../lib/engagement';
|
||||||
import { FADE_SCALE, FADE_UP, STAGGER_FAST, getMotionContainerProps, getMotionItemProps, prefersReducedMotion } from '../lib/motion';
|
import { FADE_SCALE, FADE_UP, STAGGER_FAST, getMotionContainerPropsForNavigation, getMotionItemProps, prefersReducedMotion } from '../lib/motion';
|
||||||
import PullToRefresh from '../components/PullToRefresh';
|
import PullToRefresh from '../components/PullToRefresh';
|
||||||
|
|
||||||
const GENERIC_ERROR = 'GENERIC_ERROR';
|
const GENERIC_ERROR = 'GENERIC_ERROR';
|
||||||
@@ -343,6 +343,7 @@ function PersonalActions({ token, t, tasksEnabled }: PersonalActionsProps) {
|
|||||||
|
|
||||||
export default function AchievementsPage() {
|
export default function AchievementsPage() {
|
||||||
const { token } = useParams<{ token: string }>();
|
const { token } = useParams<{ token: string }>();
|
||||||
|
const navigationType = useNavigationType();
|
||||||
const identity = useGuestIdentity();
|
const identity = useGuestIdentity();
|
||||||
const { t, locale } = useTranslation();
|
const { t, locale } = useTranslation();
|
||||||
const { event } = useEventData();
|
const { event } = useEventData();
|
||||||
@@ -393,7 +394,7 @@ export default function AchievementsPage() {
|
|||||||
|
|
||||||
const hasPersonal = Boolean(data?.personal);
|
const hasPersonal = Boolean(data?.personal);
|
||||||
const motionEnabled = !prefersReducedMotion();
|
const motionEnabled = !prefersReducedMotion();
|
||||||
const containerMotion = getMotionContainerProps(motionEnabled, STAGGER_FAST);
|
const containerMotion = getMotionContainerPropsForNavigation(motionEnabled, STAGGER_FAST, navigationType);
|
||||||
const fadeUpMotion = getMotionItemProps(motionEnabled, FADE_UP);
|
const fadeUpMotion = getMotionItemProps(motionEnabled, FADE_UP);
|
||||||
const fadeScaleMotion = getMotionItemProps(motionEnabled, FADE_SCALE);
|
const fadeScaleMotion = getMotionItemProps(motionEnabled, FADE_SCALE);
|
||||||
const tabMotion = motionEnabled
|
const tabMotion = motionEnabled
|
||||||
|
|||||||
Reference in New Issue
Block a user