diff --git a/components/app.js b/components/app.js index 1d0151dd20485b0117374abc6c5f83be2e4671fc..cef888e0121a69c46b610416aa7517dd5efa4080 100644 --- a/components/app.js +++ b/components/app.js @@ -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() && diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index 5a393062a2d87072b27682866bd32fdddcaa6dd4..4df2f283f7da5d96d50747b2589e81457dd31f6c 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -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 }}> diff --git a/components/cycle-day/symptoms/symptom-view.js b/components/cycle-day/symptoms/symptom-view.js index 749a87367615cba106a572b5d518356766125496..d192f67dea3d430d102563d4f20481828212a751 100644 --- a/components/cycle-day/symptoms/symptom-view.js +++ b/components/cycle-day/symptoms/symptom-view.js @@ -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={ diff --git a/components/header/title.js b/components/header/title.js index eb5c8bafd1496b3ddeca61fe010eac9254ddd544..f667ded24cdeb84d3c10a2f39880e90dd7b2fd08 100644 --- a/components/header/title.js +++ b/components/header/title.js @@ -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 = { diff --git a/components/helpers/format-date.js b/components/helpers/format-date.js index cf63f70c378d8c9625d0a25e4c886f7aca958574..d353dc645542dc73df2303bc84fd28069c2863cd 100644 --- a/components/helpers/format-date.js +++ b/components/helpers/format-date.js @@ -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) {