add type to consts + remove if block
This commit is contained in:
parent
d3db06a90c
commit
ddcd9899b3
@ -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: {
|
android: {
|
||||||
title: "In order to use the camera, you need to grant app permissions.",
|
title: "In order to use the camera, you need to grant app permissions.",
|
||||||
message: "Please go to Railbird > App Info and grant permissions. ",
|
message: "Please go to Railbird > App Info and grant permissions. ",
|
||||||
|
@ -7,10 +7,6 @@ const ALERT_TYPE = {
|
|||||||
|
|
||||||
export const showAlert = (alertType: string) => {
|
export const showAlert = (alertType: string) => {
|
||||||
const alert = ALERT_TYPE[alertType];
|
const alert = ALERT_TYPE[alertType];
|
||||||
if (!alert) {
|
|
||||||
console.error("No alert matches this alert type:", alertType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const { title, message } = alert[Platform.OS];
|
const { title, message } = alert[Platform.OS];
|
||||||
Alert.alert(title, message);
|
Alert.alert(title, message);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user