From 1813bf82f973678803dec9001ff7ff8b8f75feb1 Mon Sep 17 00:00:00 2001 From: BloodyMarie Date: Sun, 10 Apr 2022 21:16:06 +0200 Subject: [PATCH] Fix: Specify the title for timePicker in IOS --- components/cycle-day/temperature.js | 1 + .../settings/reminders/temperature-reminder.js | 14 +++++++++++--- i18n/en.json | 7 ++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/components/cycle-day/temperature.js b/components/cycle-day/temperature.js index af1e99e..ef516ac 100644 --- a/components/cycle-day/temperature.js +++ b/components/cycle-day/temperature.js @@ -94,6 +94,7 @@ const Temperature = ({ data, date, save }) => { onConfirm={setTime} onCancel={() => setIsTimePickerVisible(false)} display={Platform.OS === 'ios' ? 'spinner' : 'default'} + headerTextIOS="Pick a time" /> diff --git a/components/settings/reminders/temperature-reminder.js b/components/settings/reminders/temperature-reminder.js index f8e09ee..2f1acf9 100644 --- a/components/settings/reminders/temperature-reminder.js +++ b/components/settings/reminders/temperature-reminder.js @@ -1,9 +1,13 @@ import React, { Component } from 'react' +import { Platform } from 'react-native' import DateTimePicker from 'react-native-modal-datetime-picker' import AppSwitch from '../../common/app-switch' -import { saveTempReminder, tempReminderObservable } from '../../../local-storage' +import { + saveTempReminder, + tempReminderObservable, +} from '../../../local-storage' import padWithZeros from '../../helpers/pad-time-with-zeros' import labels from '../../../i18n/en/settings' @@ -43,8 +47,10 @@ export default class TemperatureReminder extends Component { render() { const { isEnabled, isTimePickerVisible, time } = this.state - const tempReminderText = time && isEnabled ? - labels.tempReminder.timeSet(time) : labels.tempReminder.noTimeSet + const tempReminderText = + time && isEnabled + ? labels.tempReminder.timeSet(time) + : labels.tempReminder.noTimeSet return ( @@ -58,6 +64,8 @@ export default class TemperatureReminder extends Component { mode="time" onConfirm={this.onPickDate} onCancel={this.onPickDateCancel} + display={Platform.OS === 'ios' ? 'spinner' : 'default'} + headerTextIOS="Pick a time" /> ) diff --git a/i18n/en.json b/i18n/en.json index ee932d6..c335e65 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,10 +7,11 @@ "cycleDay": " day of your cycle", "cyclePhase": " cycle phase - ", "addDataForToday": "add data for today" - }, + }, "shared": { "cancel": "Cancel", - "ok": "OK" + "ok": "OK", + "dateTimePickerTitle": "Pick a time" } }, "settings": { @@ -19,4 +20,4 @@ "text": "Copyright (C) {{currentYear}} Bloody Health GbR\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: https://www.gnu.org/licenses/gpl-3.0.html\n\nYou can contact us by drip@mailbox.org." } } -} \ No newline at end of file +}