import * as React from 'react' import styled, { css } from 'styled-components/native' import { OButton, OIcon, OText } from '../shared' import { useTheme } from 'styled-components/native' import { Platform, TextStyle } from 'react-native' import { ViewStyle } from 'react-native' const btnBackArrow = { borderWidth: 0, backgroundColor: '#FFF', borderColor: '#FFF', shadowColor: '#FFF', paddingLeft: 0, height: 40, } const Wrapper = styled.View` background-color: ${(props: any) => props.theme.colors.white}; padding: 4px 40px; flex-direction: row; justify-content: center; align-items: center; position: relative; ` const TitleWrapper = styled.View` flex-direction: column; padding-horizontal: 10px; ` const TitleTopWrapper = styled.View` flex-grow: 1; flex-direction: row; align-items: center; justify-content: center; ` interface Props { navigation?: any, route?: any, title?: string, subTitle?: any, titleColor?: string, titleAlign?: any, withIcon?: boolean, icon?: any, leftImg?: any, isBackStyle?: boolean, onActionLeft?: () => void, onRightAction?: () => void, rightImg?: any, titleStyle?: TextStyle, btnStyle?: TextStyle, style?: ViewStyle, paddingTop?: number, noBorder?: boolean, } const NavBar = (props: Props) => { const theme = useTheme(); const goSupport = () => { props.navigation.navigate('Supports', {}); } return ( {props.withIcon ? ( ) : null } {props.title || ''} {props.subTitle ? (props.subTitle) : null } {props.rightImg != null && () } ) } NavBar.defaultProps = { title: '', textAlign: 'center' }; export default NavBar;