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.

23 lines (22 loc) 790 B
import React from "react"; import { StyleSheet, Text, TouchableOpacity } from "react-native"; import { useDialogStyles } from "./DialogProvider"; export function DialogAction({ adornmentStart, adornmentEnd, textStyle, style, children, ...props }) { const { action } = useDialogStyles(); return (React.createElement(TouchableOpacity, { activeOpacity: 0.7, ...props, style: [styles.button, action?.button, style] }, adornmentStart, React.createElement(Text, { style: [styles.text, action?.text, textStyle] }, children), adornmentEnd)); } const styles = StyleSheet.create({ button: { flexDirection: "row", padding: 5, borderRadius: 8, alignItems: "center", gap: 6, }, text: { fontSize: 16, }, });