Skip to content
Snippets Groups Projects
Commit f444de0b authored by Sofiya Tepikin's avatar Sofiya Tepikin
Browse files

Removes the lowercasing to the header title component

parent 580f1e79
No related branches found
No related tags found
No related merge requests found
......@@ -18,13 +18,6 @@ import {headerTitles, menuTitles} from '../i18n/en/labels'
import setupNotifications from '../lib/notifications'
import { closeDb } from '../db'
// design wants everyhting lowercased, but we don't
// have CSS pseudo properties
const headerTitlesLowerCase = Object.keys(headerTitles).reduce((acc, curr) => {
acc[curr] = headerTitles[curr].toLowerCase()
return acc
}, {})
const HOME_PAGE = 'Home'
const CYCLE_DAY_PAGE = 'CycleDay'
const SETTINGS_MENU_PAGE = 'SettingsMenu'
......@@ -107,7 +100,7 @@ class App extends Component {
...symptomViews
}
const Page = pages[currentPage]
const title = headerTitlesLowerCase[currentPage]
const title = headerTitles[currentPage]
const hasDefaultHeader =
!this.isSymptomView() &&
......
......@@ -66,8 +66,7 @@ class CycleDayOverView extends Component {
const { getCycleDayNumber } = cycleModule()
const cycleDayNumber = getCycleDayNumber(date)
const headerSubtitle =
cycleDayNumber && `Cycle day ${cycleDayNumber}`.toLowerCase()
const headerSubtitle = cycleDayNumber && `Cycle day ${cycleDayNumber}`
return (
<View style={{ flex: 1 }}>
......
......@@ -106,7 +106,7 @@ class SymptomView extends Component {
return (
<View style={{flex: 1}}>
<Header
title={headerTitles[symptom].toLowerCase()}
title={headerTitles[symptom]}
subtitle={formatDate(this.date)}
handleBack={this.props.handleBackButtonPress}
handleDelete={
......
......@@ -10,18 +10,24 @@ export default function Title({ title, subtitle }) {
return (
<View>
<Text style={styles.dateHeader} testID='headerTitle'>
{title}
{ // design wants everyhting lowercased, but we don't
// have CSS pseudo properties
title.toLowerCase()}
</Text>
{ subtitle &&
<Text style={styles.cycleDayNumber} testID='headerSubtitle'>
{subtitle}
{subtitle.toLowerCase()}
</Text>
}
</View>
)
}
return <Text testID='headerTitle' style={styles.headerText}>{title}</Text>
return (
<Text testID='headerTitle' style={styles.headerText}>
{title.toLowerCase()}
</Text>
)
}
Title.propTypes = {
......
......@@ -4,8 +4,9 @@ import moment from 'moment'
export default function (date) {
const today = LocalDate.now()
const dateToDisplay = LocalDate.parse(date)
const formattedDate = today.equals(dateToDisplay) ? 'today' : moment(date).format('MMMM Do YYYY')
return formattedDate.toLowerCase()
return today.equals(dateToDisplay) ?
'today' :
moment(date).format('MMMM Do YYYY')
}
export function formatDateForShortText (date) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment