import * as React from 'react'; import { StyleProp, StyleSheet, TextStyle } from 'react-native'; import color from 'color'; import type { ThemeProp } from 'src/types'; import { useInternalTheme } from '../../core/theming'; import Text from '../Typography/Text'; export type Props = React.ComponentProps & { /** * @optional */ theme?: ThemeProp; /** * Style that is passed to Text element. */ style?: StyleProp; /** * Specifies the largest possible scale a text font can reach. */ maxFontSizeMultiplier?: number; }; /** * A component used to display a header in lists. * * ## Usage * ```js * import * as React from 'react'; * import { List } from 'react-native-paper'; * * const MyComponent = () => My List Title; * * export default MyComponent; * ``` */ const ListSubheader = ({ style, theme: overrideTheme, maxFontSizeMultiplier, ...rest }: Props) => { const theme = useInternalTheme(overrideTheme); const textColor = theme.isV3 ? theme.colors.onSurfaceVariant : color(theme.colors.text).alpha(0.54).rgb().string(); const font = theme.isV3 ? theme.fonts.bodyMedium : theme.fonts.medium; return ( ); }; ListSubheader.displayName = 'List.Subheader'; const styles = StyleSheet.create({ container: { paddingHorizontal: 16, paddingVertical: 13, }, }); export default ListSubheader;