77} from '@gorhom/bottom-sheet' ;
88import { cn } from '@ledgerhq/ldls-utils-shared' ;
99import { cva } from 'class-variance-authority' ;
10- import { remapProps } from 'nativewind' ;
10+ import { cssInterop } from 'nativewind' ;
1111import { FC } from 'react' ;
1212
1313const styles = cva ( 'mt-16 flex-1 px-16 pb-24' ) ;
@@ -26,15 +26,35 @@ export type BottomSheetVirtualizedListProps = Parameters<
2626 typeof GorhomBottomSheetVirtualizedList
2727> [ 0 ] ;
2828
29+ // Apply cssInterop to map className to style prop for Gorhom components
30+ const StyledBottomSheetView = cssInterop ( GorhomBottomSheetView , {
31+ className : 'style' ,
32+ } ) ;
33+ const StyledBottomSheetFlatList = cssInterop ( GorhomBottomSheetFlatList , {
34+ className : 'style' ,
35+ } ) ;
36+ const StyledBottomSheetSectionList = cssInterop ( GorhomBottomSheetSectionList , {
37+ className : 'style' ,
38+ } ) ;
39+ const StyledBottomSheetScrollView = cssInterop ( GorhomBottomSheetScrollView , {
40+ className : 'style' ,
41+ } ) ;
42+ const StyledBottomSheetVirtualizedList = cssInterop (
43+ GorhomBottomSheetVirtualizedList ,
44+ {
45+ className : 'style' ,
46+ } ,
47+ ) ;
48+
2949export const BottomSheetView : FC < BottomSheetViewProps > = ( {
3050 children,
3151 className,
3252 ...props
3353} ) => {
3454 return (
35- < _BottomSheetView className = { cn ( className , styles ( ) ) } { ...props } >
55+ < StyledBottomSheetView className = { cn ( className , styles ( ) ) } { ...props } >
3656 { children }
37- </ _BottomSheetView >
57+ </ StyledBottomSheetView >
3858 ) ;
3959} ;
4060
@@ -44,56 +64,48 @@ export const BottomSheetFlatList: FC<BottomSheetFlatListProps> = ({
4464 ...props
4565} ) => {
4666 return (
47- < _BottomSheetFlatList className = { cn ( className , styles ( ) ) } { ...props } >
67+ < StyledBottomSheetFlatList className = { cn ( className , styles ( ) ) } { ...props } >
4868 { children }
49- </ _BottomSheetFlatList >
69+ </ StyledBottomSheetFlatList >
5070 ) ;
5171} ;
72+
5273export const BottomSheetSectionList : FC < BottomSheetSectionListProps > = ( {
5374 children,
5475 className,
5576 ...props
5677} ) => {
5778 return (
58- < _BottomSheetSectionList className = { cn ( className , styles ( ) ) } { ...props } >
79+ < StyledBottomSheetSectionList
80+ className = { cn ( className , styles ( ) ) }
81+ { ...props }
82+ >
5983 { children }
60- </ _BottomSheetSectionList >
84+ </ StyledBottomSheetSectionList >
6185 ) ;
6286} ;
87+
6388export const BottomSheetScrollView : FC < BottomSheetScrollViewProps > = ( {
6489 children,
6590 className,
6691 ...props
6792} ) => {
6893 return (
69- < _BottomSheetScrollView className = { cn ( className , styles ( ) ) } { ...props } >
94+ < StyledBottomSheetScrollView className = { cn ( className , styles ( ) ) } { ...props } >
7095 { children }
71- </ _BottomSheetScrollView >
96+ </ StyledBottomSheetScrollView >
7297 ) ;
7398} ;
99+
74100export const BottomSheetVirtualizedList : FC <
75101 BottomSheetVirtualizedListProps
76102> = ( { children, className, ...props } ) => {
77103 return (
78- < _BottomSheetVirtualizedList className = { cn ( className , styles ( ) ) } { ...props } >
104+ < StyledBottomSheetVirtualizedList
105+ className = { cn ( className , styles ( ) ) }
106+ { ...props }
107+ >
79108 { children }
80- </ _BottomSheetVirtualizedList >
109+ </ StyledBottomSheetVirtualizedList >
81110 ) ;
82111} ;
83-
84- const _BottomSheetView = remapProps ( GorhomBottomSheetView , {
85- className : 'style' ,
86- } ) ;
87- const _BottomSheetFlatList = remapProps ( GorhomBottomSheetFlatList , {
88- className : 'style' ,
89- } ) ;
90- const _BottomSheetSectionList = remapProps ( GorhomBottomSheetSectionList , {
91- className : 'style' ,
92- } ) ;
93- const _BottomSheetScrollView = remapProps ( GorhomBottomSheetScrollView , {
94- className : 'style' ,
95- } ) ;
96- const _BottomSheetVirtualizedList = remapProps (
97- GorhomBottomSheetVirtualizedList ,
98- { className : 'style' } ,
99- ) ;
0 commit comments