mirror of
https://github.com/wassname/talk.git
synced 2026-07-08 02:41:54 +08:00
26 lines
741 B
JavaScript
26 lines
741 B
JavaScript
import React from 'react';
|
|
import {murmur3} from 'murmurhash-js';
|
|
import {CSSTransitionGroup} from 'react-transition-group';
|
|
import styles from './CommentAnimatedEdit.css';
|
|
|
|
export default ({children, body}) => {
|
|
return (
|
|
<CSSTransitionGroup
|
|
component={'div'}
|
|
className={styles.root}
|
|
transitionName={{
|
|
enter: styles.bodyEnter,
|
|
enterActive: styles.bodyEnterActive,
|
|
leave: styles.bodyLeave,
|
|
leaveActive: styles.bodyLeaveActive,
|
|
}}
|
|
transitionEnter={true}
|
|
transitionLeave={true}
|
|
transitionEnterTimeout={3600}
|
|
transitionLeaveTimeout={2800}
|
|
>
|
|
{React.cloneElement(React.Children.only(children), {key: murmur3(body)})}
|
|
</CSSTransitionGroup>
|
|
);
|
|
};
|