From 05f6d77970c1bd5750845a0a27567e6a88366755 Mon Sep 17 00:00:00 2001 From: shadowusr Date: Fri, 5 Apr 2024 00:00:39 +0300 Subject: [PATCH] fix: fix review issues --- .storybook/main.ts | 2 +- src/components/AnimatedPlanet/hooks/useAnimatedPlane.ts | 4 ++-- src/components/AnimatedPlanet/hooks/useAnimatedStar.ts | 4 ++-- src/components/AnimatedPlanet/hooks/useAnimatedTrail.ts | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 2084605..8dfae3a 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,4 +1,4 @@ -import * as path from "path"; +import path from "path"; import { fileURLToPath } from "url"; import type { StorybookConfig } from "@storybook/react-webpack5"; diff --git a/src/components/AnimatedPlanet/hooks/useAnimatedPlane.ts b/src/components/AnimatedPlanet/hooks/useAnimatedPlane.ts index 679e65b..79ce9ef 100644 --- a/src/components/AnimatedPlanet/hooks/useAnimatedPlane.ts +++ b/src/components/AnimatedPlanet/hooks/useAnimatedPlane.ts @@ -1,11 +1,11 @@ import { easings, SpringRef, SpringValue, useSpring } from "react-spring"; -interface AnimatedPlaneTrailReturnType { +interface AnimatedPlaneReturnType { props: { opacity: SpringValue; offsetDistance: SpringValue }; api: SpringRef<{ opacity: number; offsetDistance: string }>; } -export const useAnimatedPlane = (delay: number, duration: number): AnimatedPlaneTrailReturnType => { +export const useAnimatedPlane = (delay: number, duration: number): AnimatedPlaneReturnType => { const [props, api] = useSpring(() => ({ from: { opacity: 0, offsetDistance: "0%" }, to: { opacity: 1, offsetDistance: "100%" }, diff --git a/src/components/AnimatedPlanet/hooks/useAnimatedStar.ts b/src/components/AnimatedPlanet/hooks/useAnimatedStar.ts index b9a8f36..74b3a27 100644 --- a/src/components/AnimatedPlanet/hooks/useAnimatedStar.ts +++ b/src/components/AnimatedPlanet/hooks/useAnimatedStar.ts @@ -1,11 +1,11 @@ import { easings, SpringRef, SpringValue, useSpring } from "react-spring"; -interface AnimatedPlaneTrailReturnType { +interface AnimatedStarReturnType { props: { scale: SpringValue; rotateZ: SpringValue }; api: SpringRef<{ scale: number; rotateZ: number }>; } -export const useAnimatedStar = (delay: number, duration: number): AnimatedPlaneTrailReturnType => { +export const useAnimatedStar = (delay: number, duration: number): AnimatedStarReturnType => { const [props, api] = useSpring(() => ({ from: { scale: 0, rotateZ: -360 }, to: { scale: 1, rotateZ: 0 }, diff --git a/src/components/AnimatedPlanet/hooks/useAnimatedTrail.ts b/src/components/AnimatedPlanet/hooks/useAnimatedTrail.ts index 766f7c2..900f06c 100644 --- a/src/components/AnimatedPlanet/hooks/useAnimatedTrail.ts +++ b/src/components/AnimatedPlanet/hooks/useAnimatedTrail.ts @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import { easings, SpringRef, SpringValue, useSpring } from "react-spring"; -interface AnimatedPlaneTrailReturnType { +interface AnimatedTrailReturnType { props: { strokeDashoffset: SpringValue }; api: SpringRef<{ strokeDashoffset: number }>; isAnimationReady: boolean; @@ -19,8 +19,8 @@ export const useAnimatedTrail = ( pathRef: React.RefObject, delay: number, duration: number, -): AnimatedPlaneTrailReturnType => { - const [trailTotalLength, setTrailTotalLength] = useState(0); +): AnimatedTrailReturnType => { + const [trailTotalLength, setTrailTotalLength] = useState(0); const [isAnimationReady, setIsAnimationReady] = useState(false); useEffect(() => {