Application Android et IOS pour l'amicale des élèves https://play.google.com/store/apps/details?id=fr.amicaleinsat.application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Update.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // @flow
  2. import i18n from 'i18n-js';
  3. /**
  4. * Singleton used to manage update slides.
  5. * Must be a singleton because it uses translations.
  6. *
  7. * Change values in this class to change the update slide.
  8. * You will also need to update those translations:
  9. * <ul>
  10. * <li>intro.updateSlide.title</li>
  11. * <li>intro.updateSlide.text</li>
  12. * </ul>
  13. */
  14. export default class Update {
  15. // Increment the number to show the update slide
  16. static number = 6;
  17. // Change the number of slides to display
  18. static slidesNumber = 4;
  19. // Change the icons to be displayed on the update slide
  20. static iconList = ['star', 'clock', 'qrcode-scan', 'account'];
  21. static colorsList = [
  22. ['#e01928', '#be1522'],
  23. ['#7c33ec', '#5e11d1'],
  24. ['#337aec', '#114ed1'],
  25. ['#e01928', '#be1522'],
  26. ];
  27. static instance: Update | null = null;
  28. titleList: Array<string>;
  29. descriptionList: Array<string>;
  30. /**
  31. * Init translations
  32. */
  33. constructor() {
  34. this.titleList = [];
  35. this.descriptionList = [];
  36. for (let i = 0; i < Update.slidesNumber; i += 1) {
  37. this.titleList.push(i18n.t(`intro.updateSlide${i}.title`));
  38. this.descriptionList.push(i18n.t(`intro.updateSlide${i}.text`));
  39. }
  40. }
  41. /**
  42. * Get this class instance or create one if none is found
  43. *
  44. * @returns {Update}
  45. */
  46. static getInstance(): Update {
  47. if (Update.instance == null) Update.instance = new Update();
  48. return Update.instance;
  49. }
  50. }