import React, { FunctionComponent, useState } from 'react'; import { View, Text, TouchableOpacity, StyleProp, ViewStyle } from 'react-native'; import Popup from '../popup/index'; import { OffsetContext } from './offsetContext'; import { useConfig } from '../configprovider'; import sidenavbarStyles from './styles'; export interface SideNavBarProps { title: string; visible: boolean; width?: string; offset?: number; position?: 'left' | 'right'; style?: StyleProp | undefined; onClose: () => void; children: React.ReactChildren; } const defaultProps = { visible: false, position: 'left', width: '80%' } as SideNavBarProps; export const SideNavBar: FunctionComponent< Partial > = (props) => { const { title, visible, width, position, children, style, onClose } = { ...defaultProps, ...props }; const { theme } = useConfig(); const styles = sidenavbarStyles(theme); const offset = props.offset ? Number(props.offset) : 20; const [isShow, setIsShow] = useState(true); const handleClick: any = (event: MouseEvent) => { event.stopPropagation(); setIsShow(!isShow); }; return ( {/* {showhead ?
📈
: null} */} {title} {children}
); }; SideNavBar.defaultProps = defaultProps; SideNavBar.displayName = 'NutSideNavBar';