FIX: Restore icons on ListItem

This commit is contained in:
Marcos Rodriguez Velez 2023-12-19 11:17:14 -04:00
parent 2936910d7d
commit 6de5f49179
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7

View file

@ -5,6 +5,8 @@ import { useTheme } from './themes';
// Update the type for the props
interface ListItemProps {
rightIcon?: object;
leftAvatar?: React.Component;
containerStyle?: object;
Component?: typeof React.Component | typeof PressableWrapper;
bottomDivider?: boolean;
@ -72,6 +74,7 @@ const ListItem: React.FC<ListItemProps> = React.memo(props => {
accessible={props.switch === undefined}
>
{props.leftIcon && <Avatar icon={props.leftIcon} />}
{props.leftAvatar && props.leftAvatar}
<RNElementsListItem.Content>
<RNElementsListItem.Title style={stylesHook.title} numberOfLines={0} accessible={props.switch === undefined}>
{props.title}
@ -98,6 +101,7 @@ const ListItem: React.FC<ListItemProps> = React.memo(props => {
) : (
<>
{props.chevron && <RNElementsListItem.Chevron iconStyle={{ transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }] }} />}
{props.rightIcon && <Avatar icon={props.rightIcon} />}
{props.switch && <Switch {...props.switch} accessibilityLabel={props.title} accessible accessibilityRole="switch" />}
{props.checkmark && <RNElementsListItem.CheckBox iconType="octaicon" checkedColor="#0070FF" checkedIcon="check" checked />}
</>