Skip to content

Commit 0e44050

Browse files
Fix: Resolve TypeScript errors in AnimatedText and Index
This commit addresses TypeScript errors related to the AnimatedText component's props and the MobileNav component's usage in Index.tsx. The errors are resolved by ensuring the correct types are used for the animation configurations and by passing the correct props to the MobileNav component.
1 parent 2016df6 commit 0e44050

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/components/AnimatedText.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
import { motion } from "framer-motion";
1+
2+
import { motion, TargetAndTransition, VariantLabels } from "framer-motion";
23
import React from "react";
34

4-
// Props para el componente AnimatedText
5+
// Props for the AnimatedText component
56
interface AnimatedTextProps {
6-
children: React.ReactNode; // Contenido del texto animado
7-
className?: string; // Clases adicionales para personalizar estilos
8-
initial?: object; // Configuración inicial de la animación (opcional)
9-
animate?: object; // Configuración de la animación final (opcional)
10-
transition?: object; // Configuración de la transición (opcional)
7+
children: React.ReactNode; // Content of the animated text
8+
className?: string; // Additional classes to customize styles
9+
initial?: boolean | TargetAndTransition | VariantLabels; // Initial animation configuration (optional)
10+
animate?: boolean | TargetAndTransition | VariantLabels; // Final animation configuration (optional)
11+
transition?: { duration?: number; ease?: string | number[]; delay?: number }; // Transition configuration (optional)
1112
}
1213

1314
const AnimatedText: React.FC<AnimatedTextProps> = ({
1415
children,
1516
className = "",
16-
initial = { opacity: 0, y: 20 }, // Valores por defecto
17+
initial = { opacity: 0, y: 20 }, // Default values
1718
animate = { opacity: 1, y: 0 },
1819
transition = { duration: 0.8 },
1920
}) => {

src/pages/Index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
import React from "react";
23
import { AnimatePresence } from "framer-motion";
34
import { Menu, X } from "lucide-react";
@@ -45,7 +46,7 @@ const Header = () => {
4546
</div>
4647
<AnimatePresence>
4748
{isMobile && isMenuOpen && (
48-
<MobileNav isMenuOpen={isMenuOpen} setIsMenuOpen={setIsMenuOpen} id="mobile-menu" />
49+
<MobileNav isMenuOpen={isMenuOpen} setIsMenuOpen={setIsMenuOpen} />
4950
)}
5051
</AnimatePresence>
5152
<div className="absolute left-0 right-0 bottom-0 translate-y-full w-full bg-alien-space-dark/80">

0 commit comments

Comments
 (0)