|
@@ -3,11 +3,12 @@
|
3
|
3
|
import * as React from 'react';
|
4
|
4
|
import {FlatList, Platform} from "react-native";
|
5
|
5
|
import {Chip, Searchbar, withTheme} from 'react-native-paper';
|
6
|
|
-import AuthenticatedScreen from "../../components/Amicale/AuthenticatedScreen";
|
|
6
|
+import AuthenticatedScreen from "../../../components/Amicale/AuthenticatedScreen";
|
7
|
7
|
import i18n from "i18n-js";
|
8
|
|
-import ClubListItem from "../../components/Lists/ClubListItem";
|
9
|
|
-import {isItemInCategoryFilter, stringMatchQuery} from "../../utils/Search";
|
10
|
|
-import ClubListHeader from "../../components/Lists/ClubListHeader";
|
|
8
|
+import ClubListItem from "../../../components/Lists/ClubListItem";
|
|
9
|
+import {isItemInCategoryFilter, stringMatchQuery} from "../../../utils/Search";
|
|
10
|
+import ClubListHeader from "../../../components/Lists/ClubListHeader";
|
|
11
|
+import HeaderButton from "../../../components/Custom/HeaderButton";
|
11
|
12
|
|
12
|
13
|
type Props = {
|
13
|
14
|
navigation: Object,
|
|
@@ -40,9 +41,9 @@ class ClubListScreen extends React.Component<Props, State> {
|
40
|
41
|
* Creates the header content
|
41
|
42
|
*/
|
42
|
43
|
componentDidMount() {
|
43
|
|
- const title = this.getSearchBar.bind(this);
|
44
|
44
|
this.props.navigation.setOptions({
|
45
|
|
- headerTitle: title,
|
|
45
|
+ headerTitle: this.getSearchBar,
|
|
46
|
+ headerRight: this.getHeaderButtons,
|
46
|
47
|
headerBackTitleVisible: false,
|
47
|
48
|
headerTitleContainerStyle: Platform.OS === 'ios' ?
|
48
|
49
|
{marginHorizontal: 0, width: '70%'} :
|
|
@@ -55,14 +56,23 @@ class ClubListScreen extends React.Component<Props, State> {
|
55
|
56
|
*
|
56
|
57
|
* @return {*}
|
57
|
58
|
*/
|
58
|
|
- getSearchBar() {
|
|
59
|
+ getSearchBar = () => {
|
59
|
60
|
return (
|
60
|
61
|
<Searchbar
|
61
|
62
|
placeholder={i18n.t('proximoScreen.search')}
|
62
|
63
|
onChangeText={this.onSearchStringChange}
|
63
|
64
|
/>
|
64
|
65
|
);
|
65
|
|
- }
|
|
66
|
+ };
|
|
67
|
+
|
|
68
|
+ /**
|
|
69
|
+ * Gets the header button
|
|
70
|
+ * @return {*}
|
|
71
|
+ */
|
|
72
|
+ getHeaderButtons = () => {
|
|
73
|
+ const onPress = this.props.navigation.navigate.bind(this, "ClubAboutScreen");
|
|
74
|
+ return <HeaderButton icon={'information'} onPress={onPress}/>;
|
|
75
|
+ };
|
66
|
76
|
|
67
|
77
|
/**
|
68
|
78
|
* Callback used when the search changes
|