import * as React from 'react'; import { StyleSheet, StyleProp, View, ViewStyle } from 'react-native'; type Props = React.ComponentPropsWithRef & { /** * Content of the `DialogActions`. */ children: React.ReactNode; style?: StyleProp; }; /** * A component to show a list of actions in a Dialog. * *
*
* *
*
* * ## Usage * ```js * import * as React from 'react'; * import { Button, Dialog, Portal } from 'react-native-paper'; * * const MyComponent = () => { * const [visible, setVisible] = React.useState(false); * * const hideDialog = () => setVisible(false); * * return ( * * * * * * * * * ); * }; * * export default MyComponent; * ``` */ const DialogActions = (props: Props) => ( {React.Children.map(props.children, (child) => React.isValidElement(child) ? React.cloneElement(child, { compact: true, }) : child )} ); DialogActions.displayName = 'Dialog.Actions'; const styles = StyleSheet.create({ container: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end', padding: 8, }, }); export default DialogActions;