UNPKG

@ontech7/react-native-dialog

Version:

Simple and lightweight dialog component for React Native, structure similar to shadcn/ui, with dimezis background blur. Compatible with Android & iOS.

26 lines (25 loc) 772 B
import React, { createContext, useContext } from "react"; import { PortalProvider } from "./components/PortalProvider"; const defaultDialogStyles = { container: {}, header: {}, body: {}, footer: {}, title: {}, description: {}, input: { wrapper: {}, textInput: {}, label: {}, }, action: { button: {}, text: {}, }, }; const DialogStyleContext = createContext(defaultDialogStyles); export const useDialogStyles = () => useContext(DialogStyleContext); export function DialogProvider({ children, customStyles, }) { return (React.createElement(DialogStyleContext.Provider, { value: { ...defaultDialogStyles, ...customStyles } }, React.createElement(PortalProvider, null, children))); }