Browse Source

Remove update toast on home, added tab icons for proxiwash

keplyx 4 years ago
parent
commit
43d73e9bd6
3 changed files with 20 additions and 4 deletions
  1. 16
    2
      components/FetchedDataSectionList.js
  2. 2
    2
      screens/HomeScreen.js
  3. 2
    0
      screens/ProxiwashScreen.js

+ 16
- 2
components/FetchedDataSectionList.js View File

@@ -5,6 +5,8 @@ import WebDataManager from "../utils/WebDataManager";
5 5
 import {Container, Content, Tab, TabHeading, Tabs, Text} from "native-base";
6 6
 import CustomHeader from "./CustomHeader";
7 7
 import {RefreshControl, SectionList, View} from "react-native";
8
+import i18n from "i18n-js";
9
+import CustomMaterialIcon from "./CustomMaterialIcon";
8 10
 
9 11
 type Props = {
10 12
     navigation: Object,
@@ -45,6 +47,10 @@ export default class FetchedDataSectionList extends React.Component<Props, State
45 47
         return ["whoa", "nah"];
46 48
     }
47 49
 
50
+    shouldShowUpdateToast() {
51
+        return true;
52
+    }
53
+
48 54
     /**
49 55
      * Refresh the FetchedData on first screen load
50 56
      */
@@ -60,7 +66,8 @@ export default class FetchedDataSectionList extends React.Component<Props, State
60 66
                 refreshing: false,
61 67
                 firstLoading: false
62 68
             });
63
-            this.webDataManager.showUpdateToast(this.getUpdateToastTranslations()[0], this.getUpdateToastTranslations()[1]);
69
+            if (this.shouldShowUpdateToast())
70
+                this.webDataManager.showUpdateToast(this.getUpdateToastTranslations()[0], this.getUpdateToastTranslations()[1]);
64 71
         });
65 72
     };
66 73
 
@@ -120,7 +127,14 @@ export default class FetchedDataSectionList extends React.Component<Props, State
120 127
         let tabbedView = [];
121 128
         for (let i = 0; i < dataset.length; i++) {
122 129
             tabbedView.push(
123
-                <Tab heading={<TabHeading><Text>{dataset[i].title}</Text></TabHeading>}>
130
+                <Tab heading={
131
+                    <TabHeading>
132
+                        <CustomMaterialIcon icon={dataset[i].icon}
133
+                                            color={'#fff'}
134
+                                            fontSize={20}
135
+                        />
136
+                        <Text>{dataset[i].title}</Text>
137
+                    </TabHeading>}>
124 138
                     <Content padder>
125 139
                         {this.getSectionList(
126 140
                             [

+ 2
- 2
screens/HomeScreen.js View File

@@ -29,8 +29,8 @@ export default class HomeScreen extends FetchedDataSectionList {
29 29
         return i18n.t("screens.home");
30 30
     }
31 31
 
32
-    getUpdateToastTranslations () {
33
-        return [i18n.t("homeScreen.listUpdated"),i18n.t("homeScreen.listUpdateFail")];
32
+    shouldShowUpdateToast(): boolean {
33
+        return false;
34 34
     }
35 35
 
36 36
     getKeyExtractor(item : Object) {

+ 2
- 0
screens/ProxiwashScreen.js View File

@@ -193,11 +193,13 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
193 193
         return [
194 194
             {
195 195
                 title: i18n.t('proxiwashScreen.dryers'),
196
+                icon: 'tumble-dryer',
196 197
                 data: fetchedData.dryers === undefined ? [] : fetchedData.dryers,
197 198
                 extraData: super.state
198 199
             },
199 200
             {
200 201
                 title: i18n.t('proxiwashScreen.washers'),
202
+                icon:  'washing-machine',
201 203
                 data: fetchedData.washers === undefined ? [] : fetchedData.washers,
202 204
                 extraData: super.state
203 205
             },

Loading…
Cancel
Save