[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 = {
|
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);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user