|
@@ -1,6 +1,6 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import i18n from "i18n-js";
|
|
3
|
+import i18n from 'i18n-js';
|
4
|
4
|
|
5
|
5
|
/**
|
6
|
6
|
* Singleton used to manage update slides.
|
|
@@ -14,51 +14,47 @@ import i18n from "i18n-js";
|
14
|
14
|
* </ul>
|
15
|
15
|
*/
|
16
|
16
|
export default class Update {
|
|
17
|
+ // Increment the number to show the update slide
|
|
18
|
+ static number = 6;
|
17
|
19
|
|
18
|
|
- // Increment the number to show the update slide
|
19
|
|
- static number = 6;
|
20
|
|
- // Change the number of slides to display
|
21
|
|
- static slidesNumber = 4;
|
22
|
|
- // Change the icons to be displayed on the update slide
|
23
|
|
- static iconList = [
|
24
|
|
- 'star',
|
25
|
|
- 'clock',
|
26
|
|
- 'qrcode-scan',
|
27
|
|
- 'account',
|
28
|
|
- ];
|
29
|
|
- static colorsList = [
|
30
|
|
- ['#e01928', '#be1522'],
|
31
|
|
- ['#7c33ec', '#5e11d1'],
|
32
|
|
- ['#337aec', '#114ed1'],
|
33
|
|
- ['#e01928', '#be1522'],
|
34
|
|
- ]
|
|
20
|
+ // Change the number of slides to display
|
|
21
|
+ static slidesNumber = 4;
|
35
|
22
|
|
36
|
|
- static instance: Update | null = null;
|
|
23
|
+ // Change the icons to be displayed on the update slide
|
|
24
|
+ static iconList = ['star', 'clock', 'qrcode-scan', 'account'];
|
37
|
25
|
|
38
|
|
- titleList: Array<string>;
|
39
|
|
- descriptionList: Array<string>;
|
|
26
|
+ static colorsList = [
|
|
27
|
+ ['#e01928', '#be1522'],
|
|
28
|
+ ['#7c33ec', '#5e11d1'],
|
|
29
|
+ ['#337aec', '#114ed1'],
|
|
30
|
+ ['#e01928', '#be1522'],
|
|
31
|
+ ];
|
40
|
32
|
|
41
|
|
- /**
|
42
|
|
- * Init translations
|
43
|
|
- */
|
44
|
|
- constructor() {
|
45
|
|
- this.titleList = [];
|
46
|
|
- this.descriptionList = [];
|
47
|
|
- for (let i = 0; i < Update.slidesNumber; i++) {
|
48
|
|
- this.titleList.push(i18n.t('intro.updateSlide' + i + '.title'))
|
49
|
|
- this.descriptionList.push(i18n.t('intro.updateSlide' + i + '.text'))
|
50
|
|
- }
|
51
|
|
- }
|
|
33
|
+ static instance: Update | null = null;
|
52
|
34
|
|
53
|
|
- /**
|
54
|
|
- * Get this class instance or create one if none is found
|
55
|
|
- *
|
56
|
|
- * @returns {Update}
|
57
|
|
- */
|
58
|
|
- static getInstance(): Update {
|
59
|
|
- return Update.instance === null ?
|
60
|
|
- Update.instance = new Update() :
|
61
|
|
- Update.instance;
|
62
|
|
- }
|
|
35
|
+ titleList: Array<string>;
|
63
|
36
|
|
64
|
|
-};
|
|
37
|
+ descriptionList: Array<string>;
|
|
38
|
+
|
|
39
|
+ /**
|
|
40
|
+ * Init translations
|
|
41
|
+ */
|
|
42
|
+ constructor() {
|
|
43
|
+ this.titleList = [];
|
|
44
|
+ this.descriptionList = [];
|
|
45
|
+ for (let i = 0; i < Update.slidesNumber; i += 1) {
|
|
46
|
+ this.titleList.push(i18n.t(`intro.updateSlide${i}.title`));
|
|
47
|
+ this.descriptionList.push(i18n.t(`intro.updateSlide${i}.text`));
|
|
48
|
+ }
|
|
49
|
+ }
|
|
50
|
+
|
|
51
|
+ /**
|
|
52
|
+ * Get this class instance or create one if none is found
|
|
53
|
+ *
|
|
54
|
+ * @returns {Update}
|
|
55
|
+ */
|
|
56
|
+ static getInstance(): Update {
|
|
57
|
+ if (Update.instance == null) Update.instance = new Update();
|
|
58
|
+ return Update.instance;
|
|
59
|
+ }
|
|
60
|
+}
|