Fork restart functionality for different platforms

This commit is contained in:
Sofiya Tepikin
2022-06-23 21:40:15 +02:00
parent ae2a05f9b0
commit f223616ee1
5 changed files with 57 additions and 33 deletions
@@ -1,28 +1,32 @@
import { Alert } from 'react-native'
import { Alert, Platform } from 'react-native'
import { shared } from '../../../i18n/en/labels'
import labels from '../../../i18n/en/settings'
export default function showBackUpReminder(okHandler, cancelHandler, isDelete) {
let title, message
if (isDelete) {
title = labels.passwordSettings.deleteBackupReminderTitle
message = labels.passwordSettings.deleteBackupReminder
} else {
title = labels.passwordSettings.backupReminderTitle
message = labels.passwordSettings.backupReminder
}
const { title, message } = isDelete
? labels.passwordSettings.deleteBackupReminder
: labels.passwordSettings.backupReminder
const { backupReminderAppendix } = labels.passwordSettings
const appendix =
Platform.OS === 'ios'
? backupReminderAppendix.ios
: backupReminderAppendix.android
Alert.alert(
title,
message,
[{
text: shared.cancel,
onPress: cancelHandler,
style: 'cancel'
}, {
text: shared.ok,
onPress: okHandler
}],
message + appendix,
[
{
text: shared.cancel,
onPress: cancelHandler,
style: 'cancel',
},
{
text: shared.ok,
onPress: okHandler,
},
],
{ onDismiss: cancelHandler }
)
}
}