Skip to content

Commit

Permalink
Refactor TextEffect component to remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
fluid-design-io committed Oct 21, 2024
1 parent 830af22 commit 364a1bf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/core/text-effects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,14 @@ export function TextEffect({
preset,
}: TextEffectProps) {
const words = children.split(/(\S+)/);
const MotionTag = motion[as as keyof typeof motion];
const selectedVariants = preset
? presetVariants[preset]
: { container: defaultContainerVariants, item: defaultItemVariants };
const containerVariants = variants?.container || selectedVariants.container;
const itemVariants = variants?.item || selectedVariants.item;

return (
<MotionTag
<motion.div
initial="hidden"
animate="visible"
aria-label={children}
Expand All @@ -141,6 +140,6 @@ export function TextEffect({
per={per}
/>
))}
</MotionTag>
</motion.div>
);
}

0 comments on commit 364a1bf

Please sign in to comment.