import { type FC } from "react"; import { ScrollView, View } from "react-native"; import type IPageContainerProps from "./type"; import stylesheet from "./stylesheet"; import { NCoreUIKitTheme } from "../../core/hooks"; const PageContainer: FC = ({ backgroundColor = "default" as keyof NCoreUIKit.ContainerContentColors, isScrollable = false, scrollViewStyle, scrollViewProps, children, style, ...props }) => { const { spaces } = NCoreUIKitTheme.useContext(); const renderScrollview = () => { if(style) { console.log("Hey!. You make wrong things. If you must be use isScrollable={true}, you must be use scrollViewStyle. Do not use style prop for this case."); } if(props) { console.log("Hey!. You make wrong things. If you must be use isScrollable={true}, you must be use scrollViewProps. Do not use default view props for this case."); } return {children} ; }; const renderView = () => { if(scrollViewStyle) { console.log("Hey!. You make wrong things. If you must be use isScrollable={false}, you must be use style. Do not use scrollViewStyle prop for this case."); } if(scrollViewProps) { console.log("Hey!. You make wrong things. If you must be use isScrollable={false}, you musn't use scrollViewProps."); } return {children} ; }; return isScrollable ? renderScrollview() : renderView(); }; export default PageContainer;