[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>
Этот коммит содержится в:
Kritik Jiyaviya
2023-10-30 16:48:57 +05:30
коммит произвёл GitHub
родитель ea23423e2a
Коммит 7ea88ff4c6

Просмотреть файл

@@ -10,26 +10,27 @@ const ANIMATION_DURATION = 350;
type Props = { type Props = {
children?: ReactNode; children?: ReactNode;
show: boolean; show: boolean;
} };
export default class MobileChannelHeaderDropdownAnimation extends React.PureComponent<Props> { const timeout = {
render() { enter: ANIMATION_DURATION,
return ( exit: ANIMATION_DURATION,
<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 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);