import React, { Component } from 'react'; import {DeviceEventEmitter, Modal, View, Text} from 'react-native'; import StyleKit from "@Style/StyleKit"; import PlatformStyles from "../models/PlatformStyles"; export default class HeaderTitleView extends Component { constructor(props) { super(props); } render() { let styles = this.getStyles(); let subtitleStyles = styles.get('headerSubtitle'); if(this.props.subtitleColor) { subtitleStyles[0].color = this.props.subtitleColor; subtitleStyles[0].opacity = 1.0; } return ( {this.props.title} {this.props.subtitle && {this.props.subtitle} } ) } getStyles() { return new PlatformStyles({ headerContainer: { backgroundColor: StyleKit.variable("stylekitContrastBackgroundColor"), flex: 1, justifyContent: 'flex-start', flexDirection: "column" }, headerContainerAndroid: { alignItems: 'flex-start', }, headerTitle: { color: StyleKit.variable("stylekitForegroundColor"), fontWeight: "bold", fontSize: 18, textAlign: "center", }, headerSubtitle: { color: StyleKit.variable("stylekitForegroundColor"), opacity: 0.6, fontSize: 12, }, headerSubtitleIOS: { textAlign: "center", }, headerSubtitleAndroid: { fontSize: 13, } }); } }