11import React from 'react' ;
2- import { Rect , Svg } from 'react-native-svg' ;
2+ import {
3+ SafeAreaView ,
4+ ScrollView ,
5+ StatusBar ,
6+ StyleSheet ,
7+ Text ,
8+ useColorScheme ,
9+ View ,
10+ } from 'react-native' ;
11+ import { Defs , Path , Pattern , Rect , Svg , SvgProps } from 'react-native-svg' ;
312
413function EmptyExample ( ) {
5- return < Svg height = "400" width = "400" > </ Svg > ;
14+ const isDarkMode = useColorScheme ( ) === 'dark' ;
15+
16+ const backgroundStyle = {
17+ backgroundColor : 'gray' ,
18+ } ;
19+
20+ return (
21+ < SafeAreaView style = { backgroundStyle } >
22+ < StatusBar
23+ barStyle = { isDarkMode ? 'light-content' : 'dark-content' }
24+ backgroundColor = { backgroundStyle . backgroundColor }
25+ />
26+ < ScrollView
27+ contentInsetAdjustmentBehavior = "automatic"
28+ style = { backgroundStyle } >
29+ < View
30+ style = { {
31+ backgroundColor : 'white' ,
32+ } } >
33+ < View style = { { width : 100 , height : 100 } } >
34+ < TestIcon color = { 'red' } />
35+ </ View >
36+ </ View >
37+ </ ScrollView >
38+ </ SafeAreaView >
39+ ) ;
640}
741EmptyExample . title = '' ;
842
@@ -14,3 +48,25 @@ const icon = (
1448const samples = [ EmptyExample ] ;
1549
1650export { icon , samples } ;
51+
52+ const TestIcon = ( props : SvgProps ) => (
53+ < Svg { ...props } >
54+ < Defs >
55+ < Pattern
56+ id = { 'pattern' }
57+ patternUnits = "userSpaceOnUse"
58+ width = { 9 }
59+ height = { 9 } >
60+ < Path d = "M -1,2 l 6,0" stroke = "currentColor" strokeWidth = { 3 } />
61+ </ Pattern >
62+ </ Defs >
63+ < Rect x = { 0 } y = { 0 } width = "100%" height = "100%" fill = { `url(#${ 'pattern' } )` } />
64+ </ Svg >
65+ ) ;
66+
67+ const styles = StyleSheet . create ( {
68+ container : {
69+ flex : 1 ,
70+ alignItems : 'center' ,
71+ } ,
72+ } ) ;
0 commit comments