Remove unused animation prop

This commit is contained in:
Nate Kelley 2025-07-22 09:27:03 -06:00
parent ffc255c5d6
commit b618bf53fa
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 5 additions and 8 deletions

View File

@ -7,8 +7,7 @@ type TokenizedTextProps = {
animation?: MarkdownAnimation; animation?: MarkdownAnimation;
animationDuration?: number; animationDuration?: number;
animationTimingFunction?: 'ease-in-out' | 'ease-in' | 'ease-out' | 'linear'; animationTimingFunction?: 'ease-in-out' | 'ease-in' | 'ease-out' | 'linear';
doNotAnimateInitialText?: boolean; isStreamFinished?: boolean;
isStreamFinished?: boolean;
}; };
const TokenizedText: React.FC<TokenizedTextProps> = React.memo( const TokenizedText: React.FC<TokenizedTextProps> = React.memo(
@ -17,7 +16,7 @@ const TokenizedText: React.FC<TokenizedTextProps> = React.memo(
animation, animation,
animationDuration, animationDuration,
animationTimingFunction, animationTimingFunction,
doNotAnimateInitialText,
isStreamFinished isStreamFinished
}) => { }) => {
const previousTextRef = useRef<string>(''); const previousTextRef = useRef<string>('');
@ -41,11 +40,11 @@ const TokenizedText: React.FC<TokenizedTextProps> = React.memo(
<span <span
key={`animated-chunk-${index}`} key={`animated-chunk-${index}`}
className={chunk.trim().length > 0 ? 'whitespace-pre-wrap' : ''} className={chunk.trim().length > 0 ? 'whitespace-pre-wrap' : ''}
style={doNotAnimateInitialText && index === 0 ? {} : animationStyle}> style={ animationStyle}>
{chunk} {chunk}
</span> </span>
), ),
[animationStyle, doNotAnimateInitialText] [animationStyle, ]
); );
const content = useMemo(() => { const content = useMemo(() => {

View File

@ -66,9 +66,7 @@ export const animateTokenizedText = (
animationsProps: Pick< animationsProps: Pick<
AnimatedMarkdownProps, AnimatedMarkdownProps,
'animation' | 'animationDuration' | 'animationTimingFunction' | 'isStreamFinished' 'animation' | 'animationDuration' | 'animationTimingFunction' | 'isStreamFinished'
> & { >
doNotAnimateInitialText?: boolean;
}
) => { ) => {
if (!animationsProps.animation) { if (!animationsProps.animation) {
return text; return text;