-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResultsNavigator.js
More file actions
74 lines (68 loc) · 1.79 KB
/
ResultsNavigator.js
File metadata and controls
74 lines (68 loc) · 1.79 KB
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
import React, { Component } from "react";
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
export default class ResultsNavigator extends Component {
constructor(props) {
super(props);
this.state = {
page: props.page,
previousCallback: props.previousCallback,
nextCallback: props.nextCallback
};
}
render() {
return (
<View style={styles.cardSearchNavbar}>
{this.state.page > 1
? <TouchableOpacity onPress={() => this.state.previousCallback()}>
<Text style={[styles.pageNavButton, styles.navButtonText]}>
{this.state.page - 1}
</Text>
</TouchableOpacity>
: <Text
style={[
styles.pageNavButton,
styles.pageNavButtonInactive,
styles.navButtonText
]}
/>}
<Text style={[styles.navButtonText]}>
{this.state.page}
</Text>
<TouchableOpacity onPress={() => this.state.nextCallback()}>
<Text style={[styles.pageNavButton, styles.navButtonText]}>
{this.state.page + 1}
</Text>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
cardSearchNavbar: {
flex: 1,
flexDirection: "row",
alignItems: "center",
justifyContent: "center"
},
pageNavButton: {
width: 40,
height: 40,
alignItems: "center",
justifyContent: "center",
color: "#000000",
borderWidth: 1,
borderColor: "#41d9f4",
borderRadius: 7,
textAlign: "center",
backgroundColor: "#41d9f4",
textAlignVertical: "center",
margin: 5
},
navButtonText: {
fontSize: 30
},
pageNavButtonInactive: {
borderColor: "#F5FCFF",
backgroundColor: "#F5FCFF"
}
});