11import type { FC } from 'react' ;
22import React from 'react' ;
3- import type { ImageSourcePropType } from 'react-native' ;
3+ import type { ImageSourcePropType , StyleProp , TextStyle , ViewStyle } from 'react-native' ;
44import { ImageBackground , View , Text } from 'react-native' ;
55import styles from './styles' ;
66
@@ -10,18 +10,34 @@ interface IEmpty {
1010 title ?: string ;
1111 text ?: string ;
1212 Img ?: ImageSourcePropType ;
13+ containerStyle ?: StyleProp < ViewStyle > ;
14+ imageStyle ?: StyleProp < ViewStyle > ;
15+ titleStyle ?: StyleProp < TextStyle > ;
16+ textStyle ?: StyleProp < TextStyle > ;
1317}
1418
1519/**
1620 * Empty flat list component
1721 * @constructor
1822 */
19- const Empty : FC < IEmpty > = ( { hasRows, isFetching, title, text, Img } ) =>
23+ const Empty : FC < IEmpty > = ( {
24+ hasRows,
25+ isFetching,
26+ title,
27+ text,
28+ Img,
29+ containerStyle,
30+ imageStyle,
31+ titleStyle,
32+ textStyle,
33+ } ) =>
2034 ( ! hasRows && ! isFetching && (
21- < View style = { styles . emptyBlock } >
22- { Img && < ImageBackground source = { Img } style = { styles . background } resizeMode = "cover" /> }
23- { title && < Text style = { styles . noFoundTitle } > { title } </ Text > }
24- { text && < Text style = { styles . noFoundText } > { text } </ Text > }
35+ < View style = { [ styles . emptyBlock , containerStyle ] } >
36+ { Img && (
37+ < ImageBackground source = { Img } style = { [ styles . background , imageStyle ] } resizeMode = "cover" />
38+ ) }
39+ { title && < Text style = { [ styles . noFoundTitle , titleStyle ] } > { title } </ Text > }
40+ { text && < Text style = { [ styles . noFoundText , textStyle ] } > { text } </ Text > }
2541 </ View >
2642 ) ) ||
2743 null ;
0 commit comments