mirror of https://github.com/buster-so/buster.git
Remove unused animation prop
This commit is contained in:
parent
ffc255c5d6
commit
b618bf53fa
|
@ -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(() => {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue