Skip to content

Commit

Permalink
android
Browse files Browse the repository at this point in the history
  • Loading branch information
nandorojo committed Dec 4, 2022
1 parent bed6329 commit 5576241
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/BurntModule.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ import { AlertOptions, ToastOptions } from "./types";
import { ToastAndroid } from "react-native";

export default {
alertAsync(_: AlertOptions) {
alertAsync({ message, title, preset, duration }: AlertOptions) {
console.warn(
"[burnt] Burnt.alertAsync() is not implemented on this Android. Please try toastAsync()."
"[burnt] Burnt.alert() is not implemented on this Android. Falling back to toast()."
);
this.toastAsync({
message,
title,
preset: preset == "done" ? "done" : preset == "error" ? "error" : "done",
duration,
});
},
toastAsync({ title, duration = 5 }: ToastOptions) {
ToastAndroid.showWithGravityAndOffset(
Expand Down

0 comments on commit 5576241

Please sign in to comment.