From 26e05120bd9f472ef2f4d7e2f406f516bb6c0045 Mon Sep 17 00:00:00 2001 From: Jacob Lurie Date: Thu, 13 Feb 2025 11:17:28 -0500 Subject: [PATCH 1/2] feat: add children style prop to list accordion --- src/components/List/ListAccordion.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/List/ListAccordion.tsx b/src/components/List/ListAccordion.tsx index 7c85098898..be8cd9ab22 100644 --- a/src/components/List/ListAccordion.tsx +++ b/src/components/List/ListAccordion.tsx @@ -12,6 +12,7 @@ import { ViewProps, ViewStyle, PressableAndroidRippleConfig, + ImageStyle, } from 'react-native'; import { ListAccordionGroupContext } from './ListAccordionGroup'; @@ -83,6 +84,10 @@ export type Props = { * Style that is passed to Description element. */ descriptionStyle?: StyleProp; + /** + * Style that is passed to children container View. + */ + childrenStyle?: StyleProp; /** * Color of the ripple effect. */ @@ -169,6 +174,7 @@ const ListAccordion = ({ theme: themeOverrides, titleStyle, descriptionStyle, + childrenStyle, titleNumberOfLines = 1, descriptionNumberOfLines = 2, rippleColor: customRippleColor, @@ -327,6 +333,7 @@ const ListAccordion = ({ return React.cloneElement(child as React.ReactElement, { style: [ theme.isV3 ? styles.childV3 : styles.child, + childrenStyle, child.props.style, ], theme, From d870fb08d2c0fb69e86b84990e15922922fc7612 Mon Sep 17 00:00:00 2001 From: Jacob Lurie Date: Thu, 13 Feb 2025 11:22:35 -0500 Subject: [PATCH 2/2] refactor: change list accordion prop comment --- src/components/List/ListAccordion.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/List/ListAccordion.tsx b/src/components/List/ListAccordion.tsx index be8cd9ab22..a23747d77c 100644 --- a/src/components/List/ListAccordion.tsx +++ b/src/components/List/ListAccordion.tsx @@ -85,7 +85,7 @@ export type Props = { */ descriptionStyle?: StyleProp; /** - * Style that is passed to children container View. + * Style that is passed to each child of the List.Accordion. */ childrenStyle?: StyleProp; /**