Skip to content

Commit fdae8ea

Browse files
committed
(App) remove eslint warning
1 parent 04b0694 commit fdae8ea

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"react-native/no-unused-styles": 2,
1212
"react-native/split-platform-components": 2,
1313
"react-native/no-inline-styles": 2,
14-
"react-native/no-color-literals": 2,
1514
"react/prop-types": 0
1615
},
1716
"env": {

example/App.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Text, TouchableOpacity, View } from 'react-native';
2+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
33

44
import { ImageHeaderScrollView, TriggeringView } from 'react-native-image-header-scroll-view';
55

@@ -10,18 +10,28 @@ export default function App() {
1010
minHeight={100}
1111
headerImage={require('./assets/NZ.jpg')}
1212
renderForeground={() => (
13-
<View style={{ height: 150, justifyContent: 'center', alignItems: 'center' }}>
13+
<View style={styles.foregroundContainer}>
1414
<TouchableOpacity onPress={() => console.log('tap!!')}>
15-
<Text style={{ backgroundColor: 'transparent' }}>Tap Me!</Text>
15+
<Text style={styles.header}>Tap Me!</Text>
1616
</TouchableOpacity>
1717
</View>
1818
)}
1919
>
20-
<View style={{ height: 1000 }}>
20+
<View style={styles.content}>
2121
<TriggeringView onHide={() => console.log('text hidden')}>
2222
<Text>Scroll Me!</Text>
2323
</TriggeringView>
2424
</View>
2525
</ImageHeaderScrollView>
2626
);
2727
}
28+
29+
const styles = StyleSheet.create({
30+
foregroundContainer: {
31+
height: 200,
32+
justifyContent: 'center',
33+
alignItems: 'center',
34+
},
35+
header: { backgroundColor: 'transparent' },
36+
content: { height: 1000 },
37+
});

0 commit comments

Comments
 (0)