From 55fabacbc0378667d8a5fa5b6552189dee912800 Mon Sep 17 00:00:00 2001 From: Robert Penner Date: Fri, 13 Dec 2024 16:14:25 +0000 Subject: [PATCH] chore(MessageBar): delete unused MessageBarTransition.tsx --- .../MessageBarGroup/MessageBarTransition.tsx | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 packages/react-components/react-message-bar/library/src/components/MessageBarGroup/MessageBarTransition.tsx diff --git a/packages/react-components/react-message-bar/library/src/components/MessageBarGroup/MessageBarTransition.tsx b/packages/react-components/react-message-bar/library/src/components/MessageBarGroup/MessageBarTransition.tsx deleted file mode 100644 index afeaa6ecf1ded..0000000000000 --- a/packages/react-components/react-message-bar/library/src/components/MessageBarGroup/MessageBarTransition.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import * as React from 'react'; -import { Transition, TransitionStatus } from 'react-transition-group'; -import { MessageBarTransitionContextProvider } from '../../contexts/messageBarTransitionContext'; -import { MessageBarGroupProps } from './MessageBarGroup.types'; - -// TODO: delete this unused code to save bytes -const getClassName = ( - status: TransitionStatus, - enterClassName: string, - exitClassName: string, - animate: MessageBarGroupProps['animate'], -) => { - switch (status) { - case 'entering': - case 'entered': - return animate === 'both' ? enterClassName : ''; - case 'exiting': - case 'exited': - return exitClassName; - default: - return ''; - } -}; - -/** - * Internal component that controls the animation transition for MessageBar components - * @internal - * @deprecated Code is unused, replaced by motion components - */ -export const MessageBarTransition: React.FC<{ - children: React.ReactElement; - enterClassName: string; - exitClassName: string; - animate: MessageBarGroupProps['animate']; -}> = ({ children, enterClassName, exitClassName, animate, ...rest }) => { - const nodeRef = React.useRef(null); - - return ( - - {state => ( - - {children} - - )} - - ); -}; - -// TODO: delete this unused code to save bytes -const MessageBarTransitionInner: React.FC<{ - children: React.ReactElement; - enterClassName: string; - exitClassName: string; - animate: MessageBarGroupProps['animate']; - nodeRef: React.Ref; - state: TransitionStatus; -}> = ({ children, state, enterClassName, exitClassName, animate, nodeRef }) => { - const className = getClassName(state, enterClassName, exitClassName, animate); - const context = React.useMemo( - () => ({ - className, - nodeRef, - }), - [className, nodeRef], - ); - - return {children}; -};