import React, {useEffect, useState} from 'react'; import {View, TouchableOpacity, Platform, Text, StatusBar} from 'react-native'; import Icon from 'react-native-vector-icons/Feather'; import {SIZE, WEIGHT} from '../../common/common'; import {h, SideMenuEvent, getElevation} from '../../utils/utils'; import * as Animatable from 'react-native-animatable'; import NavigationService from '../../services/NavigationService'; import {DDS} from '../../../App'; import {useAppContext} from '../../provider/useAppContext'; export const Header = ({ heading, canGoBack = true, hide, showSearch, menu, verticalMenu = false, sendHeight = e => {}, }) => { const {colors} = useAppContext(); let isOpen = false; return ( {canGoBack ? ( { NavigationService.goBack(); }} style={{ justifyContent: 'center', alignItems: 'flex-start', height: 40, width: 50, marginTop: 2.5, }}> ) : ( undefined )} {menu ? ( { if (isOpen) { SideMenuEvent.close(); isOpen = false; } else { SideMenuEvent.open(); isOpen = true; } }} style={{ justifyContent: 'center', alignItems: 'flex-start', height: 40, marginTop: 2.5, width: 60, }}> ) : ( undefined )} {heading} showSearch()} style={{ justifyContent: 'center', alignItems: 'flex-end', height: 40, width: 60, paddingRight: 0, }}> {verticalMenu ? ( ) : null} ); };