Skip to content

Commit

Permalink
OV-454: + added feature that backbutton return to home when clicking …
Browse files Browse the repository at this point in the history
…it in first component of /create-avatar
  • Loading branch information
stefano-lacorazza committed Sep 27, 2024
1 parent 370d6c2 commit c287216
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/bundles/create-avatar/pages/create-avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import {
Stepper,
UploadVideo,
} from '~/bundles/common/components/components.js';
import { AppRoute } from '~/bundles/common/enums/enums.js';
import {
useCallback,
useMemo,
useNavigate,
useState,
} from '~/bundles/common/hooks/hooks.js';

Expand All @@ -14,6 +16,7 @@ import { Steps } from '../enums/steps.js';
import styles from './styles.module.css';

const CreateAvatar: React.FC = () => {
const navigate = useNavigate();
const steps = useMemo(
() => [Steps.INSTRUCTIONS, Steps.UPLOAD, Steps.CONSENT],
[],
Expand Down Expand Up @@ -56,8 +59,10 @@ const CreateAvatar: React.FC = () => {
if (previousStep) {
setStep(previousStep);
}
} else {
navigate(AppRoute.ROOT);
}
}, [step, steps]);
}, [step, steps, navigate]);

return (
<Box className={styles['container']}>
Expand Down

0 comments on commit c287216

Please sign in to comment.