import * as React from "react"; import { StyleSheet, StyleProp, TextStyle } from "react-native"; import { DefaultTheme, ThemeContext } from "styled-components"; import Title from "../Text/Title"; type Props = React.ComponentPropsWithRef & { /** * Title text for the `DialogTitle`. */ children: React.ReactNode; style?: StyleProp; /** * @optional */ theme?: DefaultTheme; }; /** * A component to show a title in a Dialog. * *
*
* *
*
* * ## Usage * ```js * import * as React from 'react'; * import { Paragraph } 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 title * * This is simple dialog * * * * ); * }; * * export default MyComponent; * ``` */ const DialogTitle = ({ children, style, ...rest }: Props) => { const theme = React.useContext(ThemeContext); return ( {children} ); }; DialogTitle.displayName = "Dialog.Title"; const styles = StyleSheet.create({ text: { marginTop: 22, marginBottom: 18, marginHorizontal: 24, }, }); export default DialogTitle; // @component-docs ignore-next-line export { DialogTitle };