Skip to content

Commit 84688b7

Browse files
committed
fix(selectListItem): fix selected list item
1 parent 8fa950c commit 84688b7

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

‎src/components/ListItem/ListItem.tsx‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
import { ListItemProps, View } from '@bluebase/components';
2-
2+
import { Theme, useStyles } from '@bluebase/core';
33
import { List } from 'react-native-paper';
44
import React from 'react';
5-
import { Theme } from '@bluebase/core';
65
import { componentMapper } from '@bluebase/component-mapper';
76

7+
export const selectListItem = (props: any) => {
8+
const styles = useStyles('ChartCard', props, {
9+
background: {
10+
backgroundColor: 'rgb(166, 166, 166)',
11+
},
12+
});
13+
14+
const { selected, ...rest } = props;
15+
if (selected) return <List.Item {...rest} style={styles.background} />;
16+
return <List.Item {...rest} />;
17+
};
18+
819
export const ListItem = componentMapper(
9-
List.Item,
20+
selectListItem,
1021
{
1122
descriptionNumberOfLines: () => null,
1223
left: ({ left }: ListItemProps) => () => left,

0 commit comments

Comments
 (0)