import * as React from "react"; import { View, ViewStyle, StyleSheet, StyleProp } from "react-native"; type Props = React.ComponentPropsWithRef & { /** * Content of the `DialogScrollArea`. */ children: React.ReactNode; style?: StyleProp; }; /** * A component to show a scrollable content in a Dialog. The component only provides appropriate styling. * For the scrollable content you can use `ScrollView`, `FlatList` etc. depending on your requirement. * *
*
* *
*
* * ## Usage * ```js * import * as React from 'react'; * import { ScrollView } from 'react-native'; * import Text from 'react-native-simple-elements/components/Text'; * import Dialog from 'react-native-simple-elements/components/Dialog'; * import Portal from 'react-native-simple-elements/components/Portal'; * * const MyComponent = () => { * const [visible, setVisible] = React.useState(false); * * const hideDialog = () => setVisible(false); * * return ( * * * * * This is a scrollable area * * * * * ); * }; * * export default MyComponent; * ``` */ const DialogScrollArea = (props: Props) => ( {props.children} ); DialogScrollArea.displayName = "Dialog.ScrollArea"; const styles = StyleSheet.create({ container: { borderColor: "rgba(0, 0, 0, .12)", borderTopWidth: StyleSheet.hairlineWidth, borderBottomWidth: StyleSheet.hairlineWidth, paddingHorizontal: 24, flexGrow: 1, flexShrink: 1, }, }); export default DialogScrollArea;