|
@@ -2,9 +2,9 @@
|
2
|
2
|
|
3
|
3
|
import * as React from 'react';
|
4
|
4
|
import WebDataManager from "../utils/WebDataManager";
|
5
|
|
-import {Container, Content, Tab, TabHeading, Tabs, Text} from "native-base";
|
|
5
|
+import {Container, Tab, TabHeading, Tabs, Text} from "native-base";
|
6
|
6
|
import CustomHeader from "./CustomHeader";
|
7
|
|
-import {RefreshControl, SectionList, View, TouchableHighlight} from "react-native";
|
|
7
|
+import {RefreshControl, SectionList, View} from "react-native";
|
8
|
8
|
import CustomMaterialIcon from "./CustomMaterialIcon";
|
9
|
9
|
|
10
|
10
|
type Props = {
|
|
@@ -42,10 +42,6 @@ export default class FetchedDataSectionList extends React.Component<Props, State
|
42
|
42
|
return ["whoa", "nah"];
|
43
|
43
|
}
|
44
|
44
|
|
45
|
|
- shouldShowUpdateToast() {
|
46
|
|
- return true;
|
47
|
|
- }
|
48
|
|
-
|
49
|
45
|
/**
|
50
|
46
|
* Refresh the FetchedData on first screen load
|
51
|
47
|
*/
|
|
@@ -61,8 +57,7 @@ export default class FetchedDataSectionList extends React.Component<Props, State
|
61
|
57
|
refreshing: false,
|
62
|
58
|
firstLoading: false
|
63
|
59
|
});
|
64
|
|
- if (this.shouldShowUpdateToast())
|
65
|
|
- this.webDataManager.showUpdateToast(this.getUpdateToastTranslations()[0], this.getUpdateToastTranslations()[1]);
|
|
60
|
+ this.webDataManager.showUpdateToast(this.getUpdateToastTranslations()[0], this.getUpdateToastTranslations()[1]);
|
66
|
61
|
});
|
67
|
62
|
};
|
68
|
63
|
|
|
@@ -111,7 +106,7 @@ export default class FetchedDataSectionList extends React.Component<Props, State
|
111
|
106
|
getTabbedView(dataset: Array<Object>) {
|
112
|
107
|
let tabbedView = [];
|
113
|
108
|
for (let i = 0; i < dataset.length; i++) {
|
114
|
|
- tabbedView.push(
|
|
109
|
+ tabbedView.push(
|
115
|
110
|
<Tab heading={
|
116
|
111
|
<TabHeading>
|
117
|
112
|
<CustomMaterialIcon icon={dataset[i].icon}
|
|
@@ -120,19 +115,17 @@ export default class FetchedDataSectionList extends React.Component<Props, State
|
120
|
115
|
/>
|
121
|
116
|
<Text>{dataset[i].title}</Text>
|
122
|
117
|
</TabHeading>}
|
123
|
|
- key={dataset[i].title}>
|
124
|
|
- <Content padder>
|
125
|
|
- {this.getSectionList(
|
126
|
|
- [
|
127
|
|
- {
|
128
|
|
- title: dataset[i].title,
|
129
|
|
- data: dataset[i].data,
|
130
|
|
- extraData: dataset[i].extraData,
|
131
|
|
- keyExtractor: dataset[i].keyExtractor
|
132
|
|
- }
|
133
|
|
- ]
|
134
|
|
- )}
|
135
|
|
- </Content>
|
|
118
|
+ key={dataset[i].title}>
|
|
119
|
+ {this.getSectionList(
|
|
120
|
+ [
|
|
121
|
+ {
|
|
122
|
+ title: dataset[i].title,
|
|
123
|
+ data: dataset[i].data,
|
|
124
|
+ extraData: dataset[i].extraData,
|
|
125
|
+ keyExtractor: dataset[i].keyExtractor
|
|
126
|
+ }
|
|
127
|
+ ]
|
|
128
|
+ )}
|
136
|
129
|
</Tab>);
|
137
|
130
|
}
|
138
|
131
|
return tabbedView;
|
|
@@ -149,9 +142,7 @@ export default class FetchedDataSectionList extends React.Component<Props, State
|
149
|
142
|
{this.getTabbedView(dataset)}
|
150
|
143
|
</Tabs>
|
151
|
144
|
:
|
152
|
|
- <Content padder>
|
153
|
|
- {this.getSectionList(dataset)}
|
154
|
|
- </Content>
|
|
145
|
+ this.getSectionList(dataset)
|
155
|
146
|
}
|
156
|
147
|
</Container>
|
157
|
148
|
);
|