[MM-54803] Convert ./components/channel_header_dropdown/mobile_channel_header_dropdown_animation.tsx from Class to Functional component (#24949)
* Convert ./components/channel_header_dropdown/mobile_channel_header_dropdown_animation.tsx from Class to Functional component * enhancement --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ea23423e2a
Коммит
7ea88ff4c6
@@ -10,26 +10,27 @@ const ANIMATION_DURATION = 350;
|
||||
type Props = {
|
||||
children?: ReactNode;
|
||||
show: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export default class MobileChannelHeaderDropdownAnimation extends React.PureComponent<Props> {
|
||||
render() {
|
||||
return (
|
||||
<CSSTransition
|
||||
in={this.props.show}
|
||||
classNames='mobile-channel-header-dropdown'
|
||||
enter={true}
|
||||
exit={true}
|
||||
mountOnEnter={true}
|
||||
unmountOnExit={true}
|
||||
timeout={{
|
||||
enter: ANIMATION_DURATION,
|
||||
exit: ANIMATION_DURATION,
|
||||
}}
|
||||
>
|
||||
{this.props.children}
|
||||
</CSSTransition>
|
||||
);
|
||||
}
|
||||
}
|
||||
const timeout = {
|
||||
enter: ANIMATION_DURATION,
|
||||
exit: ANIMATION_DURATION,
|
||||
};
|
||||
|
||||
const MobileChannelHeaderDropdownAnimation = ({show, children}: Props) => {
|
||||
return (
|
||||
<CSSTransition
|
||||
in={show}
|
||||
classNames='mobile-channel-header-dropdown'
|
||||
enter={true}
|
||||
exit={true}
|
||||
mountOnEnter={true}
|
||||
unmountOnExit={true}
|
||||
timeout={timeout}
|
||||
>
|
||||
{children}
|
||||
</CSSTransition>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(MobileChannelHeaderDropdownAnimation);
|
||||
|
||||
Ссылка в новой задаче
Block a user