Browse Source

Move constant data in constants file

Arnaud Vergnet 3 years ago
parent
commit
b27864858b

+ 22
- 0
src/constants/ProxiwashConstants.js View File

17
     5: 'alert',
17
     5: 'alert',
18
     6: 'help-circle-outline',
18
     6: 'help-circle-outline',
19
   },
19
   },
20
+  washinsa: {
21
+    id: 'washinsa',
22
+    title: 'screens.proxiwash.washinsa.title',
23
+    subtitle: 'screens.proxiwash.washinsa.subtitle',
24
+    description: 'screens.proxiwash.washinsa.description',
25
+    tarif: 'screens.proxiwash.washinsa.tariff',
26
+    paymentMethods: 'screens.proxiwash.washinsa.paymentMethods',
27
+    icon: 'school-outline',
28
+    url:
29
+      'https://etud.insa-toulouse.fr/~amicale_app/v2/washinsa/washinsa_data.json',
30
+  },
31
+  tripodeB: {
32
+    id: 'tripodeB',
33
+    title: 'screens.proxiwash.tripodeB.title',
34
+    subtitle: 'screens.proxiwash.tripodeB.subtitle',
35
+    description: 'screens.proxiwash.tripodeB.description',
36
+    tarif: 'screens.proxiwash.tripodeB.tariff',
37
+    paymentMethods: 'screens.proxiwash.tripodeB.paymentMethods',
38
+    icon: 'domain',
39
+    url:
40
+      'https://etud.insa-toulouse.fr/~amicale_app/v2/washinsa/tripode_b_data.json',
41
+  },
20
 };
42
 };

+ 3
- 27
src/screens/Proxiwash/ProxiwashAboutScreen.js View File

6
 import {Card, Avatar, Paragraph, Title} from 'react-native-paper';
6
 import {Card, Avatar, Paragraph, Title} from 'react-native-paper';
7
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
7
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
8
 import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
8
 import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
9
+import ProxiwashConstants from '../../constants/ProxiwashConstants';
9
 
10
 
10
 const LOGO = 'https://etud.insa-toulouse.fr/~amicale_app/images/Proxiwash.png';
11
 const LOGO = 'https://etud.insa-toulouse.fr/~amicale_app/images/Proxiwash.png';
11
 
12
 
20
   url: string,
21
   url: string,
21
 };
22
 };
22
 
23
 
23
-export const PROXIWASH_DATA = {
24
-  washinsa: {
25
-    id: 'washinsa',
26
-    title: 'screens.proxiwash.washinsa.title',
27
-    subtitle: 'screens.proxiwash.washinsa.subtitle',
28
-    description: 'screens.proxiwash.washinsa.description',
29
-    tarif: 'screens.proxiwash.washinsa.tariff',
30
-    paymentMethods: 'screens.proxiwash.washinsa.paymentMethods',
31
-    icon: 'school-outline',
32
-    url:
33
-      'https://etud.insa-toulouse.fr/~amicale_app/v2/washinsa/washinsa_data.json',
34
-  },
35
-  tripodeB: {
36
-    id: 'tripodeB',
37
-    title: 'screens.proxiwash.tripodeB.title',
38
-    subtitle: 'screens.proxiwash.tripodeB.subtitle',
39
-    description: 'screens.proxiwash.tripodeB.description',
40
-    tarif: 'screens.proxiwash.tripodeB.tariff',
41
-    paymentMethods: 'screens.proxiwash.tripodeB.paymentMethods',
42
-    icon: 'domain',
43
-    url:
44
-      'https://etud.insa-toulouse.fr/~amicale_app/v2/washinsa/tripode_b_data.json',
45
-  },
46
-};
47
-
48
 /**
24
 /**
49
  * Class defining the proxiwash about screen.
25
  * Class defining the proxiwash about screen.
50
  */
26
  */
88
           />
64
           />
89
         </View>
65
         </View>
90
 
66
 
91
-        {ProxiwashAboutScreen.getCardItem(PROXIWASH_DATA.washinsa)}
67
+        {ProxiwashAboutScreen.getCardItem(ProxiwashConstants.washinsa)}
92
 
68
 
93
-        {ProxiwashAboutScreen.getCardItem(PROXIWASH_DATA.tripodeB)}
69
+        {ProxiwashAboutScreen.getCardItem(ProxiwashConstants.tripodeB)}
94
 
70
 
95
         <Card style={{margin: 5}}>
71
         <Card style={{margin: 5}}>
96
           <Card.Title
72
           <Card.Title

+ 2
- 3
src/screens/Proxiwash/ProxiwashScreen.js View File

26
 import {MASCOT_STYLE} from '../../components/Mascot/Mascot';
26
 import {MASCOT_STYLE} from '../../components/Mascot/Mascot';
27
 import MascotPopup from '../../components/Mascot/MascotPopup';
27
 import MascotPopup from '../../components/Mascot/MascotPopup';
28
 import type {SectionListDataType} from '../../components/Screens/WebSectionList';
28
 import type {SectionListDataType} from '../../components/Screens/WebSectionList';
29
-import {PROXIWASH_DATA} from './ProxiwashAboutScreen';
30
 import type {LaundromatType} from './ProxiwashAboutScreen';
29
 import type {LaundromatType} from './ProxiwashAboutScreen';
31
 
30
 
32
 const modalStateStrings = {};
31
 const modalStateStrings = {};
450
     let data: LaundromatType;
449
     let data: LaundromatType;
451
     switch (state.selectedWash) {
450
     switch (state.selectedWash) {
452
       case 'tripodeB':
451
       case 'tripodeB':
453
-        data = PROXIWASH_DATA.tripodeB;
452
+        data = ProxiwashConstants.tripodeB;
454
         break;
453
         break;
455
       default:
454
       default:
456
-        data = PROXIWASH_DATA.washinsa;
455
+        data = ProxiwashConstants.washinsa;
457
     }
456
     }
458
     return (
457
     return (
459
       <View
458
       <View

Loading…
Cancel
Save