Browse Source

Update constants to use TypeScript

Arnaud Vergnet 3 years ago
parent
commit
8ac19f36de

src/constants/AvailableWebsites.js → src/constants/AvailableWebsites.ts View File


src/constants/NewsSourcesConstants.js → src/constants/NewsSourcesConstants.ts View File

@@ -19,12 +19,12 @@
19 19
 
20 20
 // @flow
21 21
 
22
-import ICON_AMICALE from '../../assets/amicale.png';
23
-import ICON_CAMPUS from '../../assets/android.icon.png';
22
+const ICON_AMICALE = require('../../assets/amicale.png');
23
+const ICON_CAMPUS = require('../../assets/android.icon.png');
24 24
 
25 25
 export type NewsSourceType = {
26
-  icon: number,
27
-  name: string,
26
+  icon: number;
27
+  name: string;
28 28
 };
29 29
 
30 30
 export default {

src/constants/ProxiwashConstants.js → src/constants/ProxiwashConstants.ts View File

@@ -27,15 +27,15 @@ export default {
27 27
     ERROR: 5,
28 28
     UNKNOWN: 6,
29 29
   },
30
-  stateIcons: {
31
-    0: 'radiobox-blank',
32
-    1: 'progress-check',
33
-    2: 'alert-circle-outline',
34
-    3: 'check-circle',
35
-    4: 'alert-octagram-outline',
36
-    5: 'alert',
37
-    6: 'help-circle-outline',
38
-  },
30
+  stateIcons: [
31
+    'radiobox-blank',
32
+    'progress-check',
33
+    'alert-circle-outline',
34
+    'check-circle',
35
+    'alert-octagram-outline',
36
+    'alert',
37
+    'help-circle-outline',
38
+  ],
39 39
   washinsa: {
40 40
     id: 'washinsa',
41 41
     title: 'screens.proxiwash.washinsa.title',

src/constants/Update.js → src/constants/Update.tsx View File

@@ -17,8 +17,6 @@
17 17
  * along with Campus INSAT.  If not, see <https://www.gnu.org/licenses/>.
18 18
  */
19 19
 
20
-// @flow
21
-
22 20
 import * as React from 'react';
23 21
 import i18n from 'i18n-js';
24 22
 import type {IntroSlideType} from '../components/Overrides/CustomIntroSlider';
@@ -49,16 +47,16 @@ export default class Update {
49 47
     this.updateSlides = [
50 48
       {
51 49
         key: '0',
52
-        title: i18n.t(`intro.updateSlide0.title`),
53
-        text: i18n.t(`intro.updateSlide0.text`),
54
-        view: (): React.Node => <MascotIntroWelcome />,
50
+        title: i18n.t('intro.updateSlide0.title'),
51
+        text: i18n.t('intro.updateSlide0.text'),
52
+        view: () => <MascotIntroWelcome />,
55 53
         colors: ['#be1522', '#57080e'],
56 54
       },
57 55
       {
58 56
         key: '1',
59
-        title: i18n.t(`intro.updateSlide1.title`),
60
-        text: i18n.t(`intro.updateSlide1.text`),
61
-        view: (): React.Node => <IntroIcon icon="account-heart-outline" />,
57
+        title: i18n.t('intro.updateSlide1.title'),
58
+        text: i18n.t('intro.updateSlide1.text'),
59
+        view: () => <IntroIcon icon="account-heart-outline" />,
62 60
         colors: ['#9c165b', '#3e042b'],
63 61
       },
64 62
     ];

Loading…
Cancel
Save