= (props: EpicProps) => {
const platform = usePlatform();
const scroll = useRef<{ [key: string]: number }>({}).current;
const { className, activeStory, tabbar, children, viewWidth, ...restProps } = props;
useEffect(() => {
if (!tabbar && viewWidth < ViewWidth.SMALL_TABLET) {
console.warn('[Epic] Using Epic without tabbar is not recommended on mobile');
}
}, [viewWidth]);
const story = (React.Children.toArray(children) as ReactElement[]).find((story) => story.props.id === activeStory) || null;
return (
scroll[activeStory] = value}
>{story}
{tabbar}
);
};
export default withAdaptivity(Epic, {
viewWidth: true,
});