Refactors the header

This commit is contained in:
Sofiya Tepikin
2019-09-14 12:39:30 +02:00
parent 20595c6c3a
commit 5d436630d3
15 changed files with 175 additions and 195 deletions
+30
View File
@@ -0,0 +1,30 @@
import React from 'react'
import { View, Text} from 'react-native'
import PropTypes from 'prop-types'
import styles from '../../styles'
export default function Title({ title, subtitle }) {
if (subtitle !== undefined) {
return (
<View>
<Text style={styles.dateHeader} testID='headerTitle'>
{title}
</Text>
{ subtitle &&
<Text style={styles.cycleDayNumber} testID='headerSubtitle'>
{subtitle}
</Text>
}
</View>
)
}
return <Text testID='headerTitle' style={styles.headerText}>{title}</Text>
}
Title.propTypes = {
title: PropTypes.string,
subtitle: PropTypes.string,
}