-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGuidelinesScreen.js
93 lines (83 loc) · 2.15 KB
/
GuidelinesScreen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import React, { useState } from 'react';
import { View, Text, FlatList, TouchableOpacity, TextInput, StyleSheet } from 'react-native';
import { guidelines } from './mockData';
import App from './App';
const GuidelinesScreen = () => {
const [searchQuery, setSearchQuery] = useState('');
const filteredGuidelines = guidelines.filter(guideline =>
guideline.title.toLowerCase().includes(searchQuery.toLowerCase())
);
const [showApp, setApp] = useState(false);
if (showApp) {
return <App />;
}
return (
<View style={styles.container}>
<TextInput
style={styles.searchInput}
placeholder="Search for guidelines"
value={searchQuery}
onChangeText={(text) => setSearchQuery(text)}
/>
<FlatList
data={filteredGuidelines}
keyExtractor={(item) => item.id.toString()}
renderItem={({ item }) => (
<TouchableOpacity style={styles.guidelineItem}>
<Text>{item.title}</Text>
</TouchableOpacity>
)}
/>
<View style={styles.buttonBox}><TouchableOpacity
style={styles.button}
onPress={() => setApp(true)}>
<Text style={styles.buttonText}>Home</Text>
</TouchableOpacity>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
paddingTop: 100,
backgroundColor:'#0066A4',
},
searchInput: {
height: 40,
borderColor: 'white',
color: 'white',
borderWidth: 1,
marginBottom: 20,
padding: 10,
},
guidelineItem: {
padding: 10,
backgroundColor: 'white',
marginBottom: 20,
borderRadius: 5,
},
button: {
width: 100,
height: 45,
borderRadius: 10,
backgroundColor: '#FFF',
textAlign: 'center',
paddingTop: 10,
paddingBottom: 10,
alignItems: 'center',
},
buttonText: {
color: '#0066A4',
textAlign: 'center',
fontSize: 20,
},
buttonBox: {
alignItems: 'center',
width: '100%',
fontFamily: 'bell-slim',
marginBottom: 100,
}
});
export default GuidelinesScreen;