@everymatrix/casino-header-controller 0.0.238 → 0.0.242

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-header-controller",
3
- "version": "0.0.238",
3
+ "version": "0.0.242",
4
4
  "main": "dist/casino-header-controller.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "907a7c1dc6fa627973d37efccc906630b14f646a"
41
+ "gitHead": "3cc82c62fb2a642ad091ac207ae95928c21ba69c"
42
42
  }
@@ -17,8 +17,8 @@
17
17
  export let endpoint:string = '';
18
18
  export let cmsendpoint:string = '';
19
19
  export let cmsenv:string = 'stage';
20
- export let lang:string = '';
21
- export let languageslist:string = 'en,ro';
20
+ export let lang:string = 'en';
21
+ export let languageslist:string = 'en, ro';
22
22
  export let activecategory:string = '';
23
23
 
24
24
  export let operatorid:string = '';
@@ -61,14 +61,15 @@
61
61
  let loginActive:boolean = true;
62
62
  let language:string = '';
63
63
  let languagesArray:Array<string> = [];
64
- // use for medium devices styling, if necessary
65
- // const mediaQuery = window.matchMedia('(min-width: 768px)');
66
64
  let hamburgerMenuActive:boolean = false;
67
65
 
68
- let totalBalance:string = '';
69
- let cashBalance:string = '';
70
- let bonusBalance:string = '';
71
- let currency:string = '';
66
+ let fallbackSecondaryMenu = [
67
+ {
68
+ "id": 0,
69
+ "label": $_('fallbackSecondaryMenu.promotions'),
70
+ "path": "/promotions",
71
+ }
72
+ ];
72
73
 
73
74
  const menuAction = (data: any) => {
74
75
  switch (data) {
@@ -157,14 +158,10 @@
157
158
  }
158
159
 
159
160
  const initialLoad = ():void => {
160
- // split operator provided languages string into string array
161
- languagesArray = languageslist.split(',');
162
- languagesArray.forEach((languageItem:string, index:number) => {
163
- languagesArray[index] = languageItem.toUpperCase();
164
- })
165
-
161
+ languagesArray = languageslist.replace(/ /g,'').split(',');
162
+ languagesArray = languagesArray.map((language:string) => language.toUpperCase());
163
+
166
164
  selectedLanguage = lang.toUpperCase();
167
-
168
165
  createCMSUrls();
169
166
 
170
167
  getHeaderMenusData(headerURL);
@@ -187,6 +184,9 @@
187
184
  .then((data: any) => {
188
185
  mainMenuArray = data.desktop.primary;
189
186
  secondaryMenuArray = data.desktop.secondary;
187
+ if( !secondaryMenuArray.length ) {
188
+ secondaryMenuArray = fallbackSecondaryMenu;
189
+ }
190
190
  isLoading = false;
191
191
 
192
192
  resolve(data);
@@ -239,7 +239,9 @@
239
239
  {/if}
240
240
  </div>
241
241
  <div class="HeaderBranding" on:click={()=>menuAction('lobby')}>
242
- <img src={everymatrixLogo} alt="Everymatrix logo">
242
+ {#if everymatrixLogo}
243
+ <img src={everymatrixLogo} alt="Everymatrix logo">
244
+ {/if}
243
245
  </div>
244
246
 
245
247
  <div class="HeaderTopActions">
@@ -269,12 +271,14 @@
269
271
  <header class="HeaderWrapper">
270
272
  <div class="HeaderContainer">
271
273
  <div class="HeaderBranding" on:click={()=>menuAction('lobby')}>
272
- <img src={everymatrixLogo} alt="Everymatrix logo">
274
+ {#if everymatrixLogo}
275
+ <img src={everymatrixLogo} alt="Everymatrix logo">
276
+ {/if}
273
277
  </div>
274
278
 
275
279
  <nav class="HeaderMainNav">
276
280
  {#if !isLoading}
277
- <casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData {actionevent} activeindex={activeIndex} location="headerMain"/>
281
+ <casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData isprimarymenu=true {actionevent} activeindex={activeIndex} location="headerMain"/>
278
282
  {/if}
279
283
  </nav>
280
284
  <div class="HeaderTopActions">
@@ -298,7 +302,7 @@
298
302
  </div>
299
303
  <select bind:value={selectedLanguage} class="Item ItemLanguage" on:change={()=>menuAction('language')}>
300
304
  {#each languagesArray as operatorLanguage}
301
- <option value={operatorLanguage}>{operatorLanguage}</option>
305
+ <option value={operatorLanguage} selected>{operatorLanguage}</option>
302
306
  {/each}
303
307
  </select>
304
308
  </div>
@@ -334,7 +338,9 @@
334
338
  </svg>
335
339
  </div>
336
340
  <div class="HeaderBranding" on:click={()=>menuAction('lobby')}>
337
- <img src={everymatrixLogo} alt="Everymatrix logo">
341
+ {#if everymatrixLogo}
342
+ <img src={everymatrixLogo} alt="Everymatrix logo">
343
+ {/if}
338
344
  </div>
339
345
 
340
346
  <div class="HeaderTopActions">
@@ -349,12 +355,14 @@
349
355
  <header class="HeaderWrapper">
350
356
  <div class="HeaderContainer">
351
357
  <div class="HeaderBranding" on:click={()=>menuAction('lobby')}>
352
- <img src={everymatrixLogo} alt="Everymatrix logo">
358
+ {#if everymatrixLogo}
359
+ <img src={everymatrixLogo} alt="Everymatrix logo">
360
+ {/if}
353
361
  </div>
354
362
 
355
363
  <nav class="HeaderMainNav">
356
364
  {#if !isLoading}
357
- <casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData {actionevent} activeindex={activeIndex} location="headerMain"/>
365
+ <casino-slider class="HeaderItemsMenu" {identity} use:sendSliderData isprimarymenu=true {actionevent} activeindex={activeIndex} location="headerMain"/>
358
366
  {/if}
359
367
  </nav>
360
368
  <div class="HeaderTopActions">
@@ -380,7 +388,7 @@
380
388
  {/if}
381
389
  {/if}
382
390
 
383
- <casino-hamburger-menu menuitemsurl={hamburgerURL} {activecategory} {language}></casino-hamburger-menu>
391
+ <casino-hamburger-menu menuitemsurl={hamburgerURL} {activecategory} {lang} {languageslist}></casino-hamburger-menu>
384
392
 
385
393
  <style lang="scss">
386
394
  //This function does a multiplication
@@ -4,6 +4,9 @@ export const CasinoHeaderController = {
4
4
  login: 'Login',
5
5
  register: 'Register',
6
6
  deposit: 'Deposit',
7
+ },
8
+ fallbackSecondaryMenu: {
9
+ promotions: 'Promotions',
7
10
  }
8
11
  },
9
12
  tr: {
@@ -11,6 +14,9 @@ export const CasinoHeaderController = {
11
14
  login: 'Giriş yapmak',
12
15
  register: 'Kayıt olmak',
13
16
  deposit: 'Depozito',
17
+ },
18
+ fallbackSecondaryMenu: {
19
+ promotions: 'Promosyonlar',
14
20
  }
15
21
  },
16
22
  ro: {
@@ -18,6 +24,9 @@ export const CasinoHeaderController = {
18
24
  login: 'Autentificare',
19
25
  register: 'Inregistreaza-te',
20
26
  deposit: 'Depozit',
27
+ },
28
+ fallbackSecondaryMenu: {
29
+ promotions: 'Promotii',
21
30
  }
22
31
  },
23
32
  };