add type to consts + remove if block

This commit is contained in:
Loewy 2024-02-12 13:47:50 -08:00
parent d3db06a90c
commit ddcd9899b3
2 changed files with 12 additions and 5 deletions

View File

@ -1,4 +1,15 @@
export const CAMERA_PERMISSION_DENIED = {
interface PermissionMessage {
android: {
title: string;
message: string;
};
ios: {
title: string;
message: string;
};
}
export const CAMERA_PERMISSION_DENIED: PermissionMessage = {
android: {
title: "In order to use the camera, you need to grant app permissions.",
message: "Please go to Railbird > App Info and grant permissions. ",

View File

@ -7,10 +7,6 @@ const ALERT_TYPE = {
export const showAlert = (alertType: string) => {
const alert = ALERT_TYPE[alertType];
if (!alert) {
console.error("No alert matches this alert type:", alertType);
return;
}
const { title, message } = alert[Platform.OS];
Alert.alert(title, message);
};