application-amicale/constants/Update.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-03-11 21:04:17 +01:00
import i18n from "i18n-js";
2020-03-29 14:46:44 +02:00
/**
* Singleton used to manage update slides.
* Must be a singleton because it uses translations.
*
* Change values in this class to change the update slide.
* You will also need to update those translations:
* <ul>
* <li>intro.updateSlide.title</li>
* <li>intro.updateSlide.text</li>
* </ul>
*/
2020-03-11 21:04:17 +01:00
export default class Update {
2020-03-29 14:46:44 +02:00
// Increment the number to show the update slide
2020-03-11 21:04:17 +01:00
static number = 5;
2020-03-29 14:46:44 +02:00
// Change the icon to be displayed on the update slide
2020-03-11 21:04:17 +01:00
static icon = 'surround-sound-2-0';
static instance: Update | null = null;
2020-03-29 14:46:44 +02:00
title: string;
description: string;
/**
* Init translations
*/
2020-03-11 21:04:17 +01:00
constructor() {
this.title = i18n.t('intro.updateSlide.title');
this.description = i18n.t('intro.updateSlide.text');
}
/**
* Get this class instance or create one if none is found
2020-03-29 14:46:44 +02:00
*
2020-03-11 21:04:17 +01:00
* @returns {Update}
*/
static getInstance(): Update {
return Update.instance === null ?
Update.instance = new Update() :
Update.instance;
}
};