import React, { ComponentType } from 'react'; // import { Transition, Transitioning } from 'react-native-reanimated'; import { Lifecycle } from '../containers/layout/Lifecycle'; import { LifecyclePhase } from '@workbench-stack/core'; import Animated, { useSharedValue, withTiming } from 'react-native-reanimated'; import { useAfterInteractions } from '../hooks/use-after-interactions'; import { Box, Spinner, SafeAreaView, Center } from '@gluestack-ui/themed'; import hoistNonReactStatics from 'hoist-non-react-statics'; export function withInteractionsManaged( Component: ComponentType, Placeholder: ComponentType | null = null, interationTime?: number, ) { const Wrapped = (props: Props) => { const { interactionsComplete, opacity, setInteractionsTimeOut } = useAfterInteractions(); React.useEffect(() => { if (interationTime) setInteractionsTimeOut(interationTime); }, [interationTime]); const LoadingComponent = () => ( //
{}
//
); console.log('interactionsComplete', interactionsComplete); return ( <> {interactionsComplete ? ( ) : ( {Placeholder ? : } )} ); }; hoistNonReactStatics(Wrapped, Component); return Wrapped; } export function withLifeCycleInteractionsManaged( Component: ComponentType, Placeholder: ComponentType | null = null, interationTime?: number, ) { const Wrapped = (props: Props) => { const { interactionsComplete, opacity, setInteractionsTimeOut } = useAfterInteractions(); React.useEffect(() => { if (interationTime) setInteractionsTimeOut(interationTime); }, [interationTime]); const LoadingComponent = () => ( //
{}
//
); console.log('interactionsComplete', interactionsComplete); return ( <> {interactionsComplete ? ( ) : ( {Placeholder ? : } )} ); }; hoistNonReactStatics(Wrapped, Component); return Wrapped; } // export function withInteractionsManaged( // Component: ComponentType, // Placeholder: ComponentType | null = null, // ) { // const Wrapped = (props: Props) => { // const { transitionRef, interactionsComplete,opacity } = useAfterInteractions(); // const LoadingComponent = () => {}; // console.log('interactionsComplete', interactionsComplete); // return ( // // {interactionsComplete ? : Placeholder ? : } // // ); // }; // hoistNonReactStatics(Wrapped, Component); // return Wrapped; // } // export function withInteractionsManaged( // Component: ComponentType, // Placeholder: ComponentType | null = null, // ) { // const Wrapped = (props: Props) => { // const { transitionRef, interactionsComplete } = useAfterInteractions(); // const LoadingComponent = () => {}; // console.log('interactionsComplete', interactionsComplete); // return ( // // // // // } // style={{ flex: 1 }} // ref={transitionRef} // > // {interactionsComplete ? : Placeholder ? : } // // ); // }; // hoistNonReactStatics(Wrapped, Component); // return Wrapped; // }