Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add children style prop to list accordion #4630

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/List/ListAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ViewProps,
ViewStyle,
PressableAndroidRippleConfig,
ImageStyle,
} from 'react-native';

import { ListAccordionGroupContext } from './ListAccordionGroup';
Expand Down Expand Up @@ -83,6 +84,10 @@ export type Props = {
* Style that is passed to Description element.
*/
descriptionStyle?: StyleProp<TextStyle>;
/**
* Style that is passed to each child of the List.Accordion.
*/
childrenStyle?: StyleProp<ViewStyle | TextStyle | ImageStyle>;
/**
* Color of the ripple effect.
*/
Expand Down Expand Up @@ -169,6 +174,7 @@ const ListAccordion = ({
theme: themeOverrides,
titleStyle,
descriptionStyle,
childrenStyle,
titleNumberOfLines = 1,
descriptionNumberOfLines = 2,
rippleColor: customRippleColor,
Expand Down Expand Up @@ -327,6 +333,7 @@ const ListAccordion = ({
return React.cloneElement(child as React.ReactElement<any>, {
style: [
theme.isV3 ? styles.childV3 : styles.child,
childrenStyle,
child.props.style,
],
theme,
Expand Down