Skip to content

Instantly share code, notes, and snippets.

View Iannery's full-sized avatar
🏠
Working from home

Ian Nery Bandeira Iannery

🏠
Working from home
View GitHub Profile
@MarceloPrado
MarceloPrado / ReactNativeGlobalAlert.tsx
Created August 8, 2023 11:05
This gist describes how to build a global alert system that follows a similar API as RN's Alert.alert(). It can be cleaned up and improved, especially in the GlobalAlertManager side, but it's a good starting point.
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
/**
* This gist describes how to build a global alert system that follows a similar
* API as RN's Alert.alert().
*
* This can be cleaned up and improved, especially in the GlobalAlertManager
* side, but it's a good starting point.
*/
"use client";
import {
Dialog,
DialogContent,
DialogTitle,
DialogTrigger
} from "@/components/ui/dialog";
import useDragDrop from "@/hooks/useDragDrop";
import { cn, formatBytes } from "@/lib/utils";