From 720c53b1af4b5daf32efe162c20c972afe785acc Mon Sep 17 00:00:00 2001 From: stefano-lacorazza <112132737+stefano-lacorazza@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:06:31 -0500 Subject: [PATCH 1/5] OV-369: + add transition between components in create-avatar page --- .../common/components/stepper/stepper.tsx | 4 +- .../components/upload-video/upload-video.tsx | 11 +++- .../create-avatar/components/components.ts | 1 + .../components/instruction/instruction.tsx | 8 ++- .../create-avatar/pages/create-avatar.tsx | 60 ++++++++++++++++++- .../create-avatar/pages/styles.module.css | 6 +- 6 files changed, 80 insertions(+), 10 deletions(-) diff --git a/frontend/src/bundles/common/components/stepper/stepper.tsx b/frontend/src/bundles/common/components/stepper/stepper.tsx index 675bd5f7d..dc5c5a8db 100644 --- a/frontend/src/bundles/common/components/stepper/stepper.tsx +++ b/frontend/src/bundles/common/components/stepper/stepper.tsx @@ -19,9 +19,10 @@ import styles from './styles.module.css'; type Properties = { steps: string[]; currentStep: string; + onClickBack?: () => void; }; -const Stepper: React.FC = ({ steps, currentStep }) => { +const Stepper: React.FC = ({ steps, currentStep, onClickBack }) => { const activeStepIndex = steps.indexOf(currentStep); const progressPercent = (activeStepIndex / (steps.length - 1)) * 100; @@ -30,6 +31,7 @@ const Stepper: React.FC = ({ steps, currentStep }) => { variant="ghostIcon" aria-label="back" icon={} + onClick={onClickBack} /> ); diff --git a/frontend/src/bundles/common/components/upload-video/upload-video.tsx b/frontend/src/bundles/common/components/upload-video/upload-video.tsx index 179d6e778..261a64040 100644 --- a/frontend/src/bundles/common/components/upload-video/upload-video.tsx +++ b/frontend/src/bundles/common/components/upload-video/upload-video.tsx @@ -5,7 +5,10 @@ import { VideoPlayer } from '../video-player/video-player.js'; import { CheckboxForm, VideoDropzone } from './components/components.js'; import styles from './styles.module.css'; -const UploadVideo: React.FC = () => { +type UploadVideoProperties = { + onClickNext: () => void; +}; +const UploadVideo: React.FC = ({ onClickNext }) => { const [videoSource, setVideoSource] = useState(null); const handleRemoveVideo = useCallback(() => { @@ -38,7 +41,11 @@ const UploadVideo: React.FC = () => { onRemoveVideo={handleRemoveVideo} onSetVideo={handleSetVideo} /> -