import * as React from 'react'; import { View, ViewStyle, StyleSheet, StyleProp } from 'react-native'; import { useInternalTheme } from '../../core/theming'; import type { ThemeProp } from '../../types'; import Icon, { IconSource } from '../Icon'; export type Props = { /** * Icon to show. */ icon: IconSource; /** * Color for the icon. */ color?: string; style?: StyleProp; /** * @optional */ theme?: ThemeProp; }; const ICON_SIZE = 24; /** * A component to show an icon in a list item. * *
*
* *
*
* * ## Usage * ```js * import * as React from 'react'; * import { List, MD3Colors } from 'react-native-paper'; * * const MyComponent = () => ( * <> * * * * * ); * * export default MyComponent; * ``` */ const ListIcon = ({ icon, color: iconColor, style, theme: themeOverrides, }: Props) => { const theme = useInternalTheme(themeOverrides); return ( ); }; const styles = StyleSheet.create({ item: { margin: 8, height: 40, width: 40, alignItems: 'center', justifyContent: 'center', }, itemV3: { alignItems: 'center', justifyContent: 'center', }, }); ListIcon.displayName = 'List.Icon'; export default ListIcon;