@phonehtut/react-native-sonner
Version:
A simple and customizable toast notification system for React Native applications
15 lines (14 loc) • 697 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Toast = Toast;
var moti_1 = require("moti");
var react_native_1 = require("react-native");
var ToastItem_1 = require("./ToastItem");
function Toast(_a) {
var toasts = _a.toasts, removeToast = _a.removeToast;
return (<react_native_1.View style={{ position: 'absolute', bottom: 56, left: 0, right: 0, zIndex: 50 }}>
<moti_1.AnimatePresence>
{toasts.map(function (toast) { return (<ToastItem_1.ToastItem key={toast.id} id={toast.id} message={toast.message} type={toast.type} duration={toast.duration} onHide={removeToast}/>); })}
</moti_1.AnimatePresence>
</react_native_1.View>);
}
;