From e2a7741c0f79843d3f48c026d37d1d43e7a4ea63 Mon Sep 17 00:00:00 2001 From: ITurres Date: Tue, 9 Apr 2024 22:21:35 -0300 Subject: [PATCH] Refactor: Migrate 'Animations' ES6 functional components to ES5 - 'AccessPageVideo.tsx'. - 'Drone.tsx'. - 'FloatingAstronaut.tsx'. --- src/components/animations/AccessPageVideo.tsx | 28 +++++---- src/components/animations/Drone.tsx | 4 +- .../animations/FloatingAstronaut.tsx | 62 ++++++++++--------- 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/src/components/animations/AccessPageVideo.tsx b/src/components/animations/AccessPageVideo.tsx index a1266b7..5070f16 100644 --- a/src/components/animations/AccessPageVideo.tsx +++ b/src/components/animations/AccessPageVideo.tsx @@ -7,20 +7,22 @@ interface AccessPageVideoProps { $videoElement: RefObject | null; } -const AccessPageVideo: React.FC = ({ $videoElement }) => ( +function AccessPageVideo(props: AccessPageVideoProps): React.ReactElement { + const { $videoElement } = props; /* eslint-disable jsx-a11y/media-has-caption */ - - /* eslint-disable jsx-a11y/media-has-caption */ -); + return ( + + ); +} /* eslint-disable no-undef */ diff --git a/src/components/animations/Drone.tsx b/src/components/animations/Drone.tsx index dd12078..1593d03 100644 --- a/src/components/animations/Drone.tsx +++ b/src/components/animations/Drone.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'; import droneFile from '../../assets/images/gif/drone.gif'; import '../../styles/animations/Drone.scss'; -const Drone: React.FC = () => { +function Drone(): React.ReactElement { const [position, setPosition] = useState({ x: 0, y: 0 }); const [firstMove, setFirstMove] = useState(false); const drone = useRef(null); @@ -77,6 +77,6 @@ const Drone: React.FC = () => { }} /> ); -}; +} export default Drone; diff --git a/src/components/animations/FloatingAstronaut.tsx b/src/components/animations/FloatingAstronaut.tsx index fa42d0d..e4bd332 100644 --- a/src/components/animations/FloatingAstronaut.tsx +++ b/src/components/animations/FloatingAstronaut.tsx @@ -25,35 +25,39 @@ interface FloatingAstronautProps { }; } -const FloatingAstronaut: React.FC = ({ - animationSpeed, - maxWidth, - move, - scale, - rotation, -}) => ( - -); +function FloatingAstronaut(props: FloatingAstronautProps): React.ReactElement { + const { + animationSpeed, + maxWidth, + move, + scale, + rotation, + } = props; + + return ( + + ); +} FloatingAstronaut.defaultProps = { move: {